我正在用来自多个表的结果填充网格视图。我的问题是如何编写存储过程来一次更新多个表。我正在捕获变量中的值,如下所示,所以现在我只需要将它们传递给 sp 以更新数据库和 gridview 吗?
protected void gvOrderDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int key = Convert.ToInt32(gvOrderDetails.DataKeys[e.RowIndex].Value);
TextBox TrackingID = (TextBox)(gvOrderDetails.Rows[e.RowIndex].FindControl("txtEditTrackingID"));
TextBox OrderDate = (TextBox)(gvOrderDetails.Rows[e.RowIndex].FindControl("txtEditOrderDate"));
TextBox CustID = (TextBox)(gvOrderDetails.Rows[e.RowIndex].FindControl("txtEditCustID"));
TextBox CustomerName = (TextBox)(gvOrderDetails.Rows[e.RowIndex].FindControl("txtEditCustName"));
TextBox Address = (TextBox)(gvOrderDetails.Rows[e.RowIndex].FindControl("txtEditAddress"));
TextBox RouteID = (TextBox)(gvOrderDetails.Rows[e.RowIndex].FindControl("txtEditRouteID"));
// reset to original view
gvOrderDetails.EditIndex = -1;
//Databind
GrabandPostData();
}
编辑:使用 sql server 2012