电动牙刷什么时候充电:有关asp.net datagrid更新按钮的问题

来源:百度文库 编辑:神马品牌网 时间:2024/05/10 12:18:10
这是更新事件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;