如何在外部gridview Plz中的“单次更新"按钮(包括“编辑按钮")中编写代码(仅显示“更新按钮",而不显示在“编辑按钮"中)更正代码
问题描述:
尊敬的专家,
Dear Experts,
protected void btnUpdae_Click(object sender, EventArgs e)
{
SqlDataAdapter daq;
string connection = System.Configuration.ConfigurationManager.ConnectionStrings["MyDB"].ConnectionString;
using (SqlConnection con = new SqlConnection(connection))
{
con.Open();
daq = new SqlDataAdapter("update TextAnswers set Comments='" + grdView.Rows[1].Cells[5].Controls[0] + "', Marks=" + grdView.Rows[1].Cells[5].Controls[0] + " where Emp_ID=" + grdView.Rows[1].Cells[5].Controls[0] + "UserName='" + Request.QueryString["UserName"] + "'", con);
SqlCommandBuilder sb = new SqlCommandBuilder(daq);
sb.ConflictOption = ConflictOption.OverwriteChanges;
daq.RowUpdated += new SqlRowUpdatedEventHandler(daq_RowUpdated);
sb.ConflictOption = ConflictOption.CompareAllSearchableValues;
}
}
在此先感谢您宝贵的重播
Thank in advance your valuable replay
答
请清楚地说明您的解释有点混乱
please explain clearly your explaination is little bit confusing