471,315 Members | 2,275 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,315 software developers and data experts.

windows form datagrid question

Hi,

In my Window Form, my DataGrid1 uses DataTable MyDT as it's DataSource.
Now MyDT has 3 columns, after the following Column.Add commands,
"Column1","Column2", and "Column3".
MyDT.Columns.Add("Column1");
MyDT.Columns.Add("Column2");
MyDT.Columns.Add("Column3");
How do I add a DataRow into MyDT?
Thanks for help.
Jason
Dec 2 '05 #1
1 1017
Hi,

To add datarow:

DataRow r = MyDT.NewRow();
r["Column1"] = "xxx";
r["Column2"] = "xxx";
r["Column3"] = "xxx";
MyDT.Rows.Add(r);

"Jason Huang" wrote:
Hi,

In my Window Form, my DataGrid1 uses DataTable MyDT as it's DataSource.
Now MyDT has 3 columns, after the following Column.Add commands,
"Column1","Column2", and "Column3".
MyDT.Columns.Add("Column1");
MyDT.Columns.Add("Column2");
MyDT.Columns.Add("Column3");
How do I add a DataRow into MyDT?
Thanks for help.
Jason

Dec 2 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by PAUL EDWARDS | last post: by
reply views Thread by Chris Mayers | last post: by
4 posts views Thread by Carl Fenley | last post: by
2 posts views Thread by Wayne | last post: by
1 post views Thread by Jason Huang | last post: by
1 post views Thread by Rajesh Kumar Choudhary | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.