使用Excel時出現System.Data.OleDb.OleDbException: 找不到可安裝的 ISAM錯誤。
連接字符串:
<add name="XLS" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/Frost.xls;Extended Properties='Excel 8.0;HDR=YES;IMEX=1'" providerName="System.Data.OleDb"/>
網上大多是說連接字符串有問題,但是我的連接字符串沒有問題,因爲在我的系統上調試沒有問題,一旦提交到服務器就會提示。
最終採用把Excel在系統註冊的方式。
解決方法:
在運行裏輸入“Regsvr32 c:/windows/system32/msexcl40.dll”