标题:[求助]asp.net中更新不了是怎么回事?
取消只看楼主
elite88
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-3-27
 问题点数:0 回复次数:0 
[求助]asp.net中更新不了是怎么回事?

大家帮我看看,这是怎么回事,
string id = e.Item.Cells[0].Text;//非编辑状况
string username=((TextBox)(e.Item.Cells[1].Controls[0])).Text;
string cardid = ((TextBox)(e.Item.Cells[2].Controls[0])).Text;
string workername = ((TextBox)(e.Item.Cells[3].Controls[0])).Text;
string sex=((TextBox)(e.Item.Cells[4].Controls[0])).Text;
string huji = ((TextBox)(e.Item.Cells[5].Controls[0])).Text;
string birthdate=((TextBox)(e.Item.Cells[6].Controls[0])).Text;
string duty=((TextBox)(e.Item.Cells[7].Controls[0])).Text;
string comdate=((TextBox)(e.Item.Cells[8].Controls[0])).Text;
SqlConnection con = db.createconnection();
con.Open();
SqlCommand cmd = new SqlCommand( "update worker set username='" + username + "',cardid='"+cardid+"',workername='" + workername + "',sex='" + sex + "',huji='" + huji + "',birdate='" + birthdate + "',duty='" + duty + "',comdate='" + comdate + "' where id='"+id+"'",con);
cmd.ExecuteNonQuery();
为什么这个语句更新运行没有错误,却没有效..

搜索更多相关主题的帖子: asp 
2007-08-29 14:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-166272-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.535693 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved