我有以下代码:
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()
。有什么想法吗?