Click here to Skip to main content
15,663,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have tried to use as many connectionstrings as possible but still getting this error ,when working with Excel(.xls) using ADO.NET
Error- "Could not find installable ISAM"

Connection string code used:-

string filename = @"d:\test.xls";
string Connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ filename +";Extended Properties="+"Excel 8.0;HDR=NO;"+"";
OleDbConnection cn = new OleDbConnection(Connectionstring);
cn.Open();//this is the line where am getting error
Updated 25-Sep-13 0:02am
Alexander Dymshyts 25-Sep-13 5:55am    
It means that you cannot establish connection. Check connection string or file existance
R K 25-Sep-13 6:01am    
Thanks for responding.
i have the file correctly and not sure whether the connection string is correct ,do am missing something in the connection string?
Alexander Dymshyts 25-Sep-13 6:06am    
You can check, if your connection string is right on
Hope this helped.

1 solution

You could try :
string cnStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Docs\\Book2.xlsx;Extended Properties='Excel 12.0 xml;HDR=YES;'";

you could also try to put single quotes around the datasource :
string co = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + filename + "';Extended Properties="+"Excel 8.0;HDR=NO;"+"";

If the above fails, it could also be a security issue. But we can deal with that if the above fails. Hope this helps.
Share this answer
R K 25-Sep-13 6:06am    
thanks for the solution
i have tried the second one as am using .xls file ,but still am recieving the same error.
please advise
R K 25-Sep-13 6:09am    
I donot have Admin rights on the machine that am working on , is it causing this issue?
Alexander Dymshyts 25-Sep-13 6:11am    
It is possible. Try with admin rights.
R K 25-Sep-13 6:47am    
i have tried in Admin console too ,no result yet
Alexander Dymshyts 25-Sep-13 8:53am    
try to put try-catch on and check what error it shows.

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