Pages

Showing posts with label Datatable. Show all posts
Showing posts with label Datatable. Show all posts

Sunday, December 20, 2009

Adding order to Datatable in Ado.net


private void AddOrder(ref DataTable dtb)
{
DataColumn dc = new DataColumn();
dtb.Columns.Add("Order");
for (int i = 1; i <= dtb.Rows.Count; i++)
{
dtb.Rows[i - 1]["Order"] = i;
}
}