select R01,R02,R03,R04,R06,R07,R08,R10,R11,R12,R13,R14 from R20
这些列里面有key吗?
*****************************************************************************
签名档: http://feiyun0112.cnblogs.com/
这些列里面有key吗?
*****************************************************************************
签名档: http://feiyun0112.cnblogs.com/
你这是自动生成的updatecommand,看看具体的sql是什么
给你推荐个方法
数据表现设置主键:比如ID Guid 这种唯一值
然后点开GridView 的属性
设置 GridView 的DataKey属性 设置成刚设置的主键
然后在GridView 的RowDataBound事件里获取主键
并根据 所获取的主键 将主键值 传到dbclick 弹出的窗体里面
最后根据主键更新修改的值
下面是获取主键和添加双击事件 以及鼠标悬停时背景色的一些事件 自己看了 if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowType != DataControlRowType.Header)//鼠标在表头背景不变
{
LinkButton btn = (LinkButton)(e.Row.FindControl("IBTN_detail"));
LinkButton btn_repair = (LinkButton)(e.Row.FindControl("IBTN_Repair"));
string ID = GV_DETAIL.DataKeys[e.Row.RowIndex].Value.ToString(); //得到当前行数据ID号
//查看明細和維修 當鼠標懸浮時 背景顏色改變
btn.Attributes.Add("onmouseover", "this.style.Color='Fuchsia'");
btn.Attributes.Add("onmouseout", "this.style.Color='#ffffff'");
btn_repair.Attributes.Add("onmouseover", "this.style.Color='Fuchsia'");
btn_repair.Attributes.Add("onmouseout", "this.style.Color='#ffffff'"); //為查看明細和維修按鈕 添加單機事件
string l_strbtn = "openPublish('Form_AbnormalNotice_Publish.aspx?infotype=3&id= " + ID + "&Rnd=" + logic.GetNextDouble() + "',2)";
string l_strrepair = "openPublish('Form_AbnormalNotice_Publish.aspx?infotype=2&id= " + ID + "&Rnd=" + logic.GetNextDouble() + "',2)";
btn.Attributes.Add("onclick", l_strbtn);
btn_repair.Attributes.Add("onclick", l_strrepair);
e.Row.Attributes.Add("ondblclick ", l_strbtn);