点击grid中的编辑按钮,调出该记录信息窗口进行编辑,例如某值由4改5,在点保存后数据库记录没变,什么原因经断点查update zdy_yjgl_hylrl_yjwh set yjz_qysds='" + this.yjz_qysds.Text+ "'中 yjz_qysds='" + this.yjz_qysds.Text+ "'的值还是4,而不是新值5,哪错了
求大佬们帮忙
附代码段
<f:WindowField Width="80px" WindowID="Window1" HeaderText="编辑" Icon="Pencil" ToolTip="编辑" DataTextFormatString="{0}" DataIFrameUrlFields="hydl_dm"
DataIFrameUrlFormatString="../yjgl/hylrl_yjwh_edit.aspx?hydl_dm={0}" TextAlign="Center"/>
hylrl_yjwh_edit.aspx.cs
private void BindGrid()
{
string t_hydl_dm = Request.QueryString["hydl_dm"];
string selectsql = "select hydl_dm,p_get_codename('DM_HYDL',hydl_dm) hydl_mc,yjz_qysds,yjz_grdz from zdy_yjgl_hylrl_yjwh where hydl_dm = '" + t_hydl_dm + "'";
DataTable dt = SQLHelper.GetDataTable(selectsql);
hydl_dm.Text = dt.Rows[0]["hydl_dm"].ToString();
hydl_mc.Text = dt.Rows[0]["hydl_mc"].ToString();
yjz_qysds.Text = dt.Rows[0]["yjz_qysds"].ToString();
yjz_grdz.Text = dt.Rows[0]["yjz_grdz"].ToString();
}
protected void Save_Click(object sender, EventArgs e)
{
string t_hydl_dm = Request.QueryString["hydl_dm"];
string sql = "update zdy_yjgl_hylrl_yjwh set yjz_qysds='" + this.yjz_qysds.Text+ "',yjz_grdz='" + yjz_grdz.Text.Trim() + "' where hydl_dm='" + t_hydl_dm + "'";
SQLHelper.ExecuteNonQuery(sql);
BindGrid();
|