| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 492 人关注过本帖
标题:[求助]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
快速回复:[求助]asp.net中更新不了是怎么回事?
数据加载中...
 
   



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

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