C# 我想向datatable中添加新行,而不影响现有数据
这是将数据绑定到datatable的代码C# 我想向datatable中添加新行,而不影响现有数据,c#,winforms,C#,Winforms,这是将数据绑定到datatable的代码 dtPromotion = db.GetDatastrong text(drcheck["vb"].ToString()); //create the new row DataRow newRow = dtPromotion.NewRow(); //Set the columns newRow["Col1"] = "data"; newRow["Col2"] = "data"; //add the row to the data table dt
dtPromotion = db.GetDatastrong text(drcheck["vb"].ToString());
//create the new row
DataRow newRow = dtPromotion.NewRow();
//Set the columns
newRow["Col1"] = "data";
newRow["Col2"] = "data";
//add the row to the data table
dtPromotion.Rows.Add(newRow);