csv to dataset in visual basic 2008 and c#

Hi
I am beginner in visual programming and i like to know how i can easy put a csv file with "," separete data and then do make filters in that dataset
Regards
TOTOLITOSAsked:
Who is Participating?
 
silemoneConnect With a Mentor Commented:
Try this code in page load....

 OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + System.IO.Path.GetDirectoryName(strFileName) +"; Extended Properties = \"Text;HDR=YES;FMT=Delimited\"");
 conn.Open();
 OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM " + System.IO.Path.GetFileName(strFileName), conn);
 DataSet ds = gcnew DataSet("Temp");
 adapter.Fill(ds);
 DataTable tb = ds.Tables[0];
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.