Selecting data from csv
i want to select data from csv file here is my code
var filenamecsv="D://Data.csv";
adoConn1.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\;
Extended Properties='text;HDR=Yes;FMT=Delimited';");
adoRS1.Open("Select * From Data.csv",adoConn1,1,3);
but when i execute my project i get following error
Microsoft JET Database Engine: The Microsoft Jet database engine could not find the object 'Data.csv'. Make sure the object exists and that you spell its name and the path 开发者_如何学编程name correctly.
what should i do?
It could be that you need to escape your backslash in D:\
in the connection string and use Data Source=D:\\;
Rather than "D://Data.csv"
, try "D:\data.csv"
.
See here: http://www.connectionstrings.com/textfile for a useful reference.
精彩评论