How do I add a new DataColumn
to a DataTable
object that already contains data?
PseudoCode
//call SQL helper class to get initial data
DataTable dt = sql.ExecuteDataTable("sp_MyProc");
dt.Columns.Add("NewColumn", type(System.Int32));
foreach(DataRow row in dr.Rows)
{
//need to set value to NewColumn column
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…