471,350 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Problem binding a datagrid

I have a method which am using to bind a datagrid to a dataset

private void BindDataGrid()
{
DataTable dt = new DataTable();

for (int j=0;j<dataset1.Tables[0].Rows.Count-1;j++)
{

DataRow dr;
dr = dt.NewRow();
dr["Col1"] = j;
dr["Col2"] = dataset1.Tables[0].Rows[j]["Col2"].ToString();
dt.Rows.Add(dr);
}

mydataset.Tables.Clear();
mydataset.Tables.Add(dt); //adding to a new dataset
dgRemarks.DataSource = mydataset;
dgRemarks.DataBind();
}

I see the Remarks being populated in the for loop,but they are not getting
added to the table [dt.Rows.Add(dr)].
Can someone tell me why it is so?

thkx
Jul 21 '05 #1
0 819

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Tom Hughes | last post: by
3 posts views Thread by Piyush | last post: by
5 posts views Thread by Jeff | last post: by
3 posts views Thread by vinayak | last post: by
1 post views Thread by benoit | last post: by
4 posts views Thread by Jeff User | last post: by
3 posts views Thread by no | last post: by
9 posts views Thread by rn5a | last post: by
2 posts views Thread by =?Utf-8?B?Y3JlYXZlczA2MjI=?= | 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.