Error External table is not in the expected format

佐手、 提交于 2019-12-02 03:27:26

问题


I am trying to get data to sqlserver2005 on my C# windows application, from sheet1.xls file through oledb connection in visual studio-2008 and I am using windows7 os and I didn't installed excel on my system.

This is my connection string:

 string excelconnectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +excelfilepath + ";"+"Extended Properties='Excel 8.0;HDR=Yes;'";

I tried many ways but still i am getting this error :

"External table is not in the expected format. "

Please help me.


回答1:


Use Microsoft.ACE.OLEDB.12.0 for excel files

string excelconnectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +excelfilepath + ";"+"Extended Properties="Excel 12.0;HDR=Yes";

connectionstrings



来源:https://stackoverflow.com/questions/21521817/error-external-table-is-not-in-the-expected-format

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!