[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 400
  • Last Modified:

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
0
TOTOLITOS
Asked:
TOTOLITOS
  • 2
2 Solutions
 
silemoneCommented:
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
 
ChuyenGiaCommented:
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now