| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 572 人关注过本帖
标题:[求助问题出在哪里〉???
只看楼主 加入收藏
wamdqpi
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-8-6
收藏
 问题点数:0 回复次数:1 
[求助问题出在哪里〉???

修改数据库的sql语句 private void Button1_Click(object sender,EventArgs e) { string strConn="server=Localhost;uid=sa;pwd=137;database=qxdata"; string strCmd="update ldjh set title='"+TextBox1.Text+"' content='"+TextBox2.Text+"' name='"+TextBox3.Text+"' department='"+TextBox4.Text+"' where ID = '"+Label1.Text+"'"; SqlConnection myConnection = new SqlConnection(); myConnection.ConnectionString=strConn; myConnection.Open(); SqlCommand myCommand=new SqlCommand(strCmd,myConnection); myCommand.ExecuteNonQuery(); myCommand.Connection.Close(); myConnection.Close();

}

搜索更多相关主题的帖子: department content private sql语句 server 
2005-08-21 15:47
飘飘and栋栋
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2005-9-7
收藏
得分:0 
它报的什么错吗?我想可能是SQL语句有问题,注意:只有字段的类型为文本是才要单引号哦!
2005-09-11 14:42
快速回复:[求助问题出在哪里〉???
数据加载中...
 
   



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

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