谁能帮我,亲爱的朋友! [英] Who can help me, dear buddy!

查看:69
本文介绍了谁能帮我,亲爱的朋友!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


当我尝试从excel导入数据到表时,出现以下错误:-
System.Data.dll中发生类型为"System.Data.OleDb.OleDbException"的异常,但未在用户代码中处理

附加信息:外部表的格式不正确.

我正在使用以下代码:-
崩溃

Hi,
When I am trying to import data from excel to table it''s giving me following error :-
An exception of type ''System.Data.OleDb.OleDbException'' occurred in System.Data.dll but was not handled in user code

Additional information: External table is not in the expected format.

I am using following code:-
Collapse

OleDbConnection excelConn = new OleDbConnection();
excelConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=''" + filelocation + "'';Extended Properties=Excel 8.0");
 excelConn.Open();

推荐答案

通常,这是因为您尝试读取的文件不是真正的Excel工作簿文件.您是否正在尝试以此读取.CSV文件?
Usually, this is because the file you''re trying to read is not a real Excel workbook file. Are you trying to read a .CSV file with this?


这篇关于谁能帮我,亲爱的朋友!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆