Link to home
Start Free TrialLog in
Avatar of deplayatrix
deplayatrix

asked on

I use oledb to connect to my Excel file to read sheets in Excel file in asp.net

my code is working fine locally but when i published that code and put is in the server 2008
this code can't read the sheets inside the excel file
i'm using an asp.net web application C#

this is my code

  String connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + excelFile + ";Extended Properties=Excel 8.0;";
Avatar of lcohan
lcohan
Flag of Canada image

"my code is working fine locally but when i published that code and put is in the server 2008
this code can't read the sheets inside the excel file
i'm using an asp.net web application C#"

Obviously that SQL Server does not have Microsoft Office installed on it like your client computer does right?
Avatar of deplayatrix
deplayatrix

ASKER

i installed Microsoft Office in my server the code still not working
Sorry if I lead you in the wrong directipon - I mean I did not wanted to ask you install MS Office on the server but just to find what the issue is...
Anyway, with office installed where is that speadsheet resides? On the SQL Server?
Does the account running the C# code has sufficient rights to access it and "put is in the server 2008"?
the account is admin account and i think the issue in the connection code :

String connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + excelFile + ";Extended Properties=Excel 8.0;";

actually my application can get in the file and read which excel file inside the file but it can't read the sheets inside selected excel file

i uploaded screen shot of my application working locally the system will read all the excel file
inside the file and represented in the drobdown list and once i select noe file the system will show me in the second dropdown list the sheets in side the file but its not working in the server 2008
Untitled.png
ASKER CERTIFIED SOLUTION
Avatar of deplayatrix
deplayatrix

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
its solve my problem