Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I got error during fetching data from Excel filr my connection string & code is like that..

C#
string Filename = System.Web.Hosting.HostingEnvironment.MapPath("~//Admin//UploadFiles//" + path);
       string s = @"Data Source='" + Filename + "';Provider=Microsoft.ACE.OLEDB.12.0; Extended Properties=Excel 12.0;";
       OleDbConnection con = new OleDbConnection(s); // connection string
       con.Open();
       OleDbDataAdapter da = new OleDbDataAdapter("select * from [Sheet1$]", con);


i got this error on GoDaddy's server....

It works fine on IIS

I have already changed the Active Solution Platform from "Any CPU" to "x86".

Any suggestions are heartly welcome.. :)
Posted
Updated 15-Apr-14 23:39pm
v2

First check you have the ACE driver installed, and which version: http://social.msdn.microsoft.com/Forums/en-US/f9f335c2-6c8b-4c84-a9b3-1dae73fb534d/microsoftaceoledb12-not-registered-on-local-machine?forum=adodotnetdataproviders[^] follow the instructions and it'll tell you.

If you haven't got ACE in either version, then that will also tell you what you need to do! :laugh:
Go here and install it: http://www.microsoft.com/en-gb/download/details.aspx?id=13255[^]
But remember: you can't install both 32 and 64 bit versions on the same machine!
 
Share this answer
 
Comments
Nirav Prabtani 16-Apr-14 5:38am    
I got this error on GODADDY'S Sever...
OriginalGriff 16-Apr-14 6:01am    
Then you need to talk to GoDaddy, not us!
Nirav Prabtani 16-Apr-14 6:08am    
ya, griff i know that, i am just hopping for help that i will get some solution, thank you for your valuable time..and sorry to ask you regarding that..
OriginalGriff 16-Apr-14 6:13am    
No problem!
A quick Google search gave about 13.000 results.
Of which the first link is:
'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine error[^]

When you read the post, the first answer leads to:
HOW TO: FIX ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine"[^]

Never underestimate your search capabilities, these will eventually save a lot of your time in the future.

Good luck.
 
Share this answer
 
Comments
Nirav Prabtani 16-Apr-14 5:40am    
Ya correct, but my application is on godaddy's server so how is that useful??
AdamASPGeek 21-Apr-14 1:57am    
Do you use shared hosting on Godaddy? If yes, it seems it cant work fine if you use Excel
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900