|
Author: Jenny Nguyen
|
|
How to fix the error "Could not find installable ISAM" when using property IMEX. Recently I have to upload an Excel file into a datatable using ASP.NET. I then encounter the error. After spending many hours I finally figure out what was wrong with it, and it is a really simple fix. It all has something to do with the connectionstring. Here is my original string that I get the error: string conn = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; data source={0}; Extended Properties=Excel 8.0; HRD=Yes;IMEX=1;", file);
CORRECTION - This one will work:
string conn = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; data source={0}; Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\";", file);
If you are using multiple properties for the Extended Properties then it need to be enlosed in a double quote. So put \" to make sure it has the double quote around.
Did you like this tip?
Hopefully this will help you.
Comments (4)
"
|
Ex: Extended Properties= \"Excel 8.0;HDR=Yes;IMEX=1 \"
Connection string: "Provider=Microsoft.Jet.OLEDB.4.0; data source={0}; Extended Properties= \"Excel 8.0;HDR=Yes;IMEX=1\";"