protectedvoid gvCardInfo_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName =="pass") { int intRow =int.Parse(e.CommandArgument.ToString()); //获取当前所在行 int ID = Convert.ToInt32(gvCardInfo.DataKeys[intRow].Value.ToString()); string sql ="update Reserve set ReserveStatus=1 where ReserverID="+ID; if (sh.execCommand(sql)) { bing(); } } }