62,269
社区成员
发帖
与我相关
我的任务
分享 SqlDataAdapter customersTableAdapter =
new SqlDataAdapter(SqlDataSource1.SelectCommand, SqlDataSource1.ConnectionString);
DataTable hiberarchyTable = new DataTable();
customersTableAdapter.Fill(hiberarchyTable);
SqlCommandBuilder sqlCommandBuilder = new SqlCommandBuilder(customersTableAdapter);
DataRow newRow = hiberarchyTable.NewRow();
newRow["guotuzhenghao"] = guotuzhenghao.Value;
newRow["zuoluo"] = zuoluo.Value;
newRow["shiyongzhe"] = shiyongzhe.Value;
newRow["dihao"] = dihao.Value;
newRow["tuhao"] = tuhao.Value;
newRow["yongtu"] = yongtu.Value;
newRow["dengji"] = dengji.Value;
newRow["churangStart"] = churangStart.Value;
newRow["charangend"] = charangend.Value;
newRow["churangnianxian"] = churangnianxian.Value;
newRow["beizhu"] = beizhu.Value;
newRow["fazhengjiguan"] = fazhengjiguan.Value;
newRow["fazhengriqi"] = fazhengriqi.Value;
newRow["gongtanmianji"] = gongtanmianji.Value;
newRow["shiyongquanmianji"] = shiyongquanmianji.Value;
// newRow["s2"] = "s2";
hiberarchyTable.Rows.Add(newRow);
customersTableAdapter.Update(hiberarchyTable);
}
catch (Exception we)
{
Response.Write("<script>window.alert('新增数据出错!') </script>");
return;
}
Response.Write("<script>window.alert('新增数据成功!') </script>");
Response.Redirect("manage_add_guotushiyong.aspx?guotuzhenghao=" + guotuzhenghao.Value + "&shiyongzhe=" + shiyongzhe.Value + "&zuoluo=" + zuoluo.Value + "");
Response.Write(" <script>window.alert('新增数据成功!');window.location='"+loation+"'; </script>");
Response.Write(" <script>window.alert('新增数据成功!');window.location='"+loation+"'; </script>");