Datarow 名称 如何用变量名
DataTable dtType = SqlHelper.GetDataSet(sqlType,spType);
for (int i = 7; i < dtType.Rows.Count; i++)
{
string rowName="dr"+i.ToString())
DataRow ???= dt.NewRow();
rowName[0] = "销售件数";
rowName[1] = dtType.Rows[0][1].ToString();
rowName[2] = dtType.Rows[0][2].ToString();
rowName[3] = dtType.Rows[0][3].ToString();
rowName[4] = dtType.Rows[0][4].ToString();
rowName[5] = dtType.Rows[0][5].ToString();
rowName[6] = "达成说明啊啊啊啊啊啊啊 ";
dt.Rows.Add(dr);
}
请问如何定义datarow的名称呢
------解决方案--------------------直接用dr有何不可,每次循环都创建一个新行
------解决方案--------------------
DataTable dtType = SqlHelper.GetDataSet(sqlType,spType);
for (int i = 7; i < dtType.Rows.Count; i++)
{
DataRow rowName= dt.NewRow();
rowName[0] = "销售件数";
rowName[1] = dtType.Rows[0][1].ToString();
rowName[2] = dtType.Rows[0][2].ToString();
rowName[3] = dtType.Rows[0][3].ToString();
rowName[4] = dtType.Rows[0][4].ToStrin