I would suggest that you use the SqlDataAdapter
to populate a DataSet
, which will contain a DataTable
. I assume you want to add the new column to this DataTable
.
Here's how to do that:
SqlDataAdapter d2 = new SqlDataAdapter("select MARK_PARTA from exam_cyctstmarkdet",con);
DataSet dst = new DataSet();
d2.Fill(dst); // now you have a populated DataSet containing a DataTable
DataTable dt = dst.Tables[0]; // I created this variable for clarity; you don't really need it
DataColumn c = new DataColumn();
c.ColumnName = "parta";
c.DataType = System.Type.GetType("System.Int32");
dt.Add(c);
After you add the Column
to the DataTable
, the Column
will be empty.
You can populate it in code.