如何使用C#连接.csv文件 [英] How to connect with .csv file using c#
问题描述
海,
我正在开发一个桌面应用程序,因为我想从.csv文件导入数据.我正在使用下面的连接字符串,但显示错误.
OleDbConnection连接=新的OleDbConnection(
@"Provider = Microsoft.Jet.OLEDB.4.0; Data Source =" + pathOnly +
; Extended Properties =''Text; HDR = no''")
我收到找不到可安装的ISAM ,所以请给我正确的连接字符串.
谢谢
Sujith
Hai,
i am developing one desktop application , in that i want to import data from .csv file. I am using below connection string, but its showing error.
OleDbConnection connection = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pathOnly +
";Extended Properties=''Text;HDR=no''")
I am getting could not find installable ISAM, So please give me correct connection string.
Thanks
Sujith
推荐答案
尝试以下lib: linqtoexcel [ ^ ].我正在使用它而不是ole,并且它简单又方便.
Try this lib: linqtoexcel[^]. I''m using it instead of ole, and it''s easy and convenient.
请确保运行桌面应用程序的计算机已安装了最新的MDAC组件.解决此问题.请参考以下文章以获取更多信息:
Microsoft数据访问组件(MDAC)安装
数据访问技术路线图
最好避免使用Jet驱动程序进行更新的实现.
Please ensure that the computer where you''re running your Desktop application have latest MDAC components installed it to resolve this issue. Please refer the following articles for more information:
Microsoft Data Access Components (MDAC) Installation
Data Access Technologies Road Map
It is always better to avoid Jet driver for newer implementation.
这篇关于如何使用C#连接.csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!