TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
g a
NA
1
0
well I have some problem
Mar 22 2009 5:11 AM
StreamWriter sw = new StreamWriter("D:\\sss.txt"); DataTable dt = new DataTable(); DataColumn dc = new DataColumn("ID", typeof(string)); dc.AllowDBNull = false; dc.Unique = true; dt.Columns.Add(dc); dt.Columns.Add("FirstName", typeof(string)); dt.Columns.Add("LastName", typeof(string)); dt.Rows.Add(1, "aaa", "bbb"); dt.Rows.Add(2, "ccc", "dddd"); int length = dt.Columns.Count; int length1 = dt.Rows.Count; for (int i = 0; i < length; i++) { sw.Write(dt.Columns[i]+";"); } foreach (DataRow dr in dt.Rows) { sw.Write("\r\n" + dr[0] + " " + dr[1] + " " + dr[2]); } sw.Close(); StreamReader sr = new StreamReader("D:\\sss.txt"); a = sr.ReadLine(); while (a != null) { DataSet d = new DataSet(); Console.Write(a + "\n"); a = sr.ReadLine(); } sr.Close(); as you can see I write from datatable to txt File ad it warks well, but now I want to load it back to datatable like this: In Colums must be ID, FirsName, LastName and in Rows must be 1, "aaa", "bbb"; 2, "ccc", "dddd" what'll you advise me?
Reply
Answers (
1
)
How to Expand the particular node of tree view and collapse all other nodes with a button click
Very simple question