这是更新事件updatecommand的源码,但是不知道为什么编辑完后点更新数据还是一样的,用断点调试,发现参数的值没有变化
string ProductID=dtg1.DataKeys[e.Item.ItemIndex].ToString ();
string newname=((TextBox)(e.Item .Cells [0].Controls [0])).Text ;
string newon=((TextBox)(e.Item .Cells [2].Controls [0])).Text ;
string str1="update Products set ProductName='"+newname+"',UnitsOnOrder='"+newon
+"'where ProductID="+ProductID;
string ProductID=dtg1.DataKeys[e.Item.ItemIndex].ToString ();
string newname=((TextBox)(e.Item .Cells [0].Controls [0])).Text ;
string newon=((TextBox)(e.Item .Cells [2].Controls [0])).Text ;
string str1="update Products set ProductName='"+newname+"',UnitsOnOrder='"+newon
+"'where ProductID="+ProductID;
解决方案 »
- ISA2006做的负载均衡,/ScriptResource.axd 资源请求 出现填充无效,无法被移除
- 如何post数据到另外一个页面 ,参数不在url地址栏显示。
- asp.net中日历的奇怪问题,你碰到过没有?
- 爲什麽使用webService
- 请问怎样在asp.net中实现定时执行某程序(非js实现)?
- 怎么样设置一下,让用户输入主机ip就自动访问主机的主页面的啊
- 怎么能保存当前页面 弹出另一个新页面 而不是刷新原来页面(C#)多谢!!!!
- DataGrid出现的错误
- 系统日志的处理。欢迎讨论!
- 网页上无法播放数据库中音视频数据问题
- RE: 趣味题:__*_=___=_*__ (备注:其中"_"为一个数字,数字为1-9,但不能重复) 用程序写出结果
- 如何实现像使用"file"那样在客户端上浏览并选择一个文件夹,目的是实现客户端文件夹的上传!
+"'where ProductID='"+ProductID+"';
string str1="update Products set ProductName='"+newname+"',UnitsOnOrder='"+newon
+"'where ProductID='"+ProductID+"' ";
查看有没有更新进去...
+"'where ProductID='"+ProductID+"' ";
不行啊,还有我也重新绑定了啊》