Create DataTable Dynamically using C#
DataTable DT = new DataTable();
//Create Column
DT.Columns.Add("Column 1");
DT.Columns.Add("Column 2");
DT.Columns.Add("Column 3");
//End Column
//Create and Add New Row
DataRow DTRow= DT.NewRow();
//Inserting values to each cell in a row
DTRow[0] = "First cell";
DTRow[1] = "Second cell";
DTRow[2] = "Third cell";
DT.Rows.Add(DTRow);
Monday, November 9, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment