展开全部
GridView1.EditIndex = 0;//第一行为编辑行
DataTable myda = (DataTable)this.ViewState["table"]; //实力创建的临时表
DataRow darow = myda.NewRow(); //给表添加新的行
darow[0] = ""; //给临时表添加记录值这里一行添加了六个值
darow[1] = xm;
darow[2] = xb;
darow[3] = csrq;
darow[4] = bjid;
darow[5] = jtdz;
darow[6] = lxdh;
myda.Rows.Add(darow); //添加这一行的记录插入到表
GridView1.DataSource = myda; //绑定数据源
GridView1.DataBind();
DataTable myda = (DataTable)this.ViewState["table"]; //实力创建的临时表
DataRow darow = myda.NewRow(); //给表添加新的行
darow[0] = ""; //给临时表添加记录值这里一行添加了六个值
darow[1] = xm;
darow[2] = xb;
darow[3] = csrq;
darow[4] = bjid;
darow[5] = jtdz;
darow[6] = lxdh;
myda.Rows.Add(darow); //添加这一行的记录插入到表
GridView1.DataSource = myda; //绑定数据源
GridView1.DataBind();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询