Hi sir,
I have Ascii file seperated by comma..How can i import this file to Datagridview..could you reply this post soon..
Thanks
Anusha
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jun 26, 2013, 8:25 AM
Check out this article for one way:
http://www.c-sharpcorner.com/UploadFile/ankurmee/import-data-from-text-and-csv-file-to-datagridview-in-net/
Another way would be use the code in this link to load the data into a DataSet:
http://www.java2s.com/Code/CSharp/Database-ADO.net/ReadcommaseparatedvalueintoDataSet.htm
You can then bind the DataTable to your DataGridView with a line such as this:
dataGridView1.DataSource = myDataSet.Tables["TheData"].DefaultView;