我有以下代码:
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();
我收到以下错误:
找不到可安装的ISAM.
在connection.Open().有任何想法吗 ?
Dig*_*dia 18
我有同样的错误,但上述建议都没有奏效.在我的情况下,我所要做的就是将我的连接字符串更改为:
string connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + FilePath + ";Extended Properties='Excel 12.0;IMEX=1;'";
请注意扩展属性属性周围的单引号('Excel 12.0; IMEX = 1;').一旦我添加了这些单引号,错误就消失了!
没有64位版本的Jet OLEDB驱动程序,所以如果你在64位操作系统上运行它,你可能需要x86在.NET应用程序中定位而不是Any CPU:
