【发布时间】:2010-10-19 19:02:09
【问题描述】:
在名为 (ExcelFiles) 的文件夹中有一个名为 (a.xlsx) 的 Excel 文件。
ExcelFiles 文件夹位于我项目的根目录中。
所以我获取excel文件数据的连接字符串是这样的:
<add name="xlsx" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=aaa\ExcelFiles\a.xlsx;Extended Properties=Excel 12.0"/>
aaa = 我的项目名称
使用这个连接字符串在本地一切正常,但上传网站后出现错误。
问题出在哪里??
这条路径是否为真 -> ~/ExcelFiles/a.xlsx
你能修好这条路吗 4 me....
解决路径问题后报错如下:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
我该如何处理这个错误?
提前感谢
最好的问候
【问题讨论】:
标签: c# asp.net excel connection-string