我想从我的ASP.NET应用程序连接到.xlsx文件。无法从c#连接到excel#
这里是我的连接字符串:
string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};Data Source=\"C:\\MyExcel.xlsx\";Extended Properties=\"Excel 12.0 Xml;HDR=NO\"";
OleDbConnection oleConnection = new OleDbConnection(connString);
但是当我尝试打开连接,我得到 找不到可安装ISAM
- Office版本:2007
- OS: windows 7 64位
- .NET框架4.0
- 下载32位 ACE驾驶员http://www.microsoft.com/en-us/download/details.aspx?id=13255
我甚至改变了我的应用程序的平台,目标86,但没有成功。
请帮忙!
请检查以下问题,并确保更改平台目标在与屏幕截图上完全相同的位置:http://stackoverflow.com/questions/4214527/could-not-find-installable-isam – EvAlex 2013-03-09 06:44:58
我猜一个论坛建议使用单个代码。只需尝试一下,如下所示。 string connString =“Provider = Microsoft.ACE.OLEDB.12.0; Driver = {Microsoft Excel Driver(* .xls,* .xlsx,* .xlsm,* .xlsb)}; Data Source ='C:\\ MyExcel.xlsx ';扩展属性='Excel 12.0 Xml; HDR = NO'“; – Smaug 2013-03-09 07:00:49