Click here to Skip to main content
15,907,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
OleDbConnectionStringBuilder sb = new OleDbConnectionStringBuilder();
sb.DataSource = sfd.FileName;//save file dialog filename is the datasource
sb.Provider = "Provider=Microsoft.Jet.OLEDB.4.0;";
sb.Add("Jet OLEDB:Database Password", "123456");
sb.PersistSecurityInfo = false;

bookConn = new OleDbConnection(sb.Provider + "@Data Source=" + sb.DataSource + ";" );
bookConn.Open();
oleDbCmd.Connection = bookConn;




I get an error Saying "could not find installable ISAM " at bookConn.Open

please help me
Posted
Comments
Richard C Bishop 8-Jan-13 15:43pm    
I don't think you need the "@" in front of the Data Source and you might try adding Extended Properties such as: bookConn = new OleDbConnection(sb.Provider + "Data Source=" + sb.DataSource + ";" + "Extended Properties= "Excel 8.0;");

1 solution

The reason for this exception is because an error with connection string you prepare.

modify your connection string preparation like this
OleDbConnectionStringBuilder sb =  OleDbConnectionStringBuilder ();
sb.Add("Provider", "Microsoft.Jet.Oledb.4.0");
sb.Add("Jet OLEDB:Database Password", "*******");
sb.Add("Jet OLEDB:System Database",sfd.FileName);
bookConn = new OleDbConnection(sb.ConnectionString);


You can also refer here[^] to know more about connection string preparations. &
building-better-connectionstrings-with-connectionstringbuilder/[^]
 
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