Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want a sample coding in C#..I want to export a data from notepad to grid view...i want a sample coding for that concept...
Posted
Comments
ambarishtv 2-Jun-11 5:05am    
????

 foreach (string line1 in File.ReadAllLines(FullFileName))
                    { 
                        string[] parts = line1.Split(',');

                        aRow = tbl.NewRow();
                        aRow["Name"] = parts[0];
                        aRow["Sal"] = parts[1];
                        tbl.Rows.Add(aRow);

                    }
GVContent.DataSource = tbl;
GVContent.DataBind();


Hope this can help you.
 
Share this answer
 
v2
Notepad is a text editor, therefore you will need to read the text file as a whole or line-by-line and determine what and where field delimiters are.

You will need to use the System.IO namespace which contains classes and methods from reading and writing text files and streams.

There are plenty of code examples for reading text files, on the internet. Just Google for them
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900