Have a look on these MSDN articles:
How to: Add Rows to a DataTable[
^]
Adding Columns to a Table [
^]
And have a look on following examples for reference:
foreach(int i in collections)
{
DataRow row = dt.NewRow();
row["NewRecord"] = textbox1.text.ToString();
dt.Rows.Add(newRow);
}
DataTable workTable = new DataTable("Customers");
DataColumn workCol = workTable.Columns.Add("CustID", typeof(Int32));
workCol.AllowDBNull = false;
workCol.Unique = true;
workTable.Columns.Add("CustLName", typeof(String));
workTable.Columns.Add("CustFName", typeof(String));
workTable.Columns.Add("Purchases", typeof(Double));
Like this you can add rows to your
DataTable