Hi,
converting the csv.. to DataSet is very simple..
here is the exampl code
================================================== =======
OleDbConnection csvConn = new OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;"+
"Data Source=" + "<specify
the path."+ ";" +
"Extended
Properties=\"text;HDR=YES;FMT=Delimited\"");
OleDbDataAdapter csvDa = new OleDbDataAdapter("SELECT *
FROM " + "specify the csv file
name.<<fileName>>" ,csvConn);
Take the csvDA and Make as many DataSets u like...
Note that the first row is taken as the column header in
Data Set
mail me if you have trouble in doing the above solution
Regs
PRadeep
pr*******@hotmail.com -----Original Message-----
Hi,
See this link
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpguide/html/cpconReadingTextFromFile.asp
there you will see how to read a file,
you simply add these lines inside the loop
string[] elements = line.Split( new char[] { ','} );
Hope this help,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"tor" <to******@hotmail.com> wrote in message
news:Ow****************@TK2MSFTNGP09.phx.gbl... Hello
I have a csv file i need to split into elements.
line example:
element1;element2;elemtent3 --> e[0] = element1 e
[1] = element2 e[2] = element3
element1;"elem;ent2";elemtent3 --> e[0] = element1 e
[1] = elem;ent2e[2] = element3
element1;elem\;ent2;elemtent3 --> e[0] = element1 e
[1] = elem;ent2e[2] = element3
My question is how can i do a correct split.
line.split(';') works only on the first line
Torfinn
.