错误外部表不是预期的格式 [英] Error External table is not in the expected format
本文介绍了错误外部表不是预期的格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试从我的 C#
Windows应用程序获取数据到 sqlserver2005
,从sheet1.xls文件到oledb连接在visual studio-2008中,我使用的是windows7 os,我没有在我的系统上安装excel。
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.
这是我的连接字符串:
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. "
请帮助我。
推荐答案
使用 Microsoft.ACE.OLEDB.12.0
for excel files
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";
a href =http://www.connectionstrings.com/excel/ =nofollow> connectionstrings
connectionstrings
这篇关于错误外部表不是预期的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文