C#,vb.net,MVC,Jquery,javascript,jscript,vbscript,html,vb,sharepoint,COM,WPF,WCF,Wwf,Asp,Asp.net,questions & answers,

Latest in Sports

Monday, June 18, 2012

Error while accessing excel using ADO.net

I am accessing excel sheet through .net 4.0. I am using below connection string.
 
conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Sheet1.xlsx;Extended Properties=Excel 12.0 Xml;HRD=Yes;IMEX=1");
 
Whenever I try to open the connection I get below error.
Could not find installable ISAM.
 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel
 
I am using Windows 2007 OS.
 
Another thing I noticied is when I tried creating udl I was getting error:The selected DSN contains architectural mismatch between driver and the application. I used OLEDB driver for ODBC and selected excel sheet as data source.
I don't know whether this error is related to above 'could not find installable ISAM' error.
 
Any help would be greatly appreciated

No comments:

Post a Comment