Search code examples
c#oledb

Could not find installable ISAM


I have the following code :

string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\db\suc.xls; Extended Properties=""Excel 12.0;HDR=YES;""";

// Create Connection to Excel Workbook
using (OleDbConnection connection =
             new OleDbConnection(excelConnectionString))
{
    OleDbCommand command = new OleDbCommand
            ("Select * FROM [Sheet1$]", connection);

    connection.Open();

and i get the following error :

Could not find installable ISAM.

at connection.Open() . Any ideas ?


Solution

  • There's no 64 bit version of the Jet OLEDB drivers, so if you are running this on a 64 bit OS you might need to target x86 in your .NET application and not Any CPU:

    alt text