这个sql 语句错在哪儿? update stuffsource set" + amend +"='" + pvalue +"'";amend 是变量,必须引起来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把SQL语句打出来,在查询分析器中看看错误的原因 同意loveprograming() 如果“amend”不是表中的字段,那问题就出在这了 " if exists(select * from stuffsource where bh='"+pid+"') 没注意到最后少了一个双引号吗?又亦或bh如果不是字符型就不用单引号了 pvalue 这个字段很可能不是字符型的,不用单引号,仔细再看看。 string pid = TextBox1.Text.Trim();string amend = TextBox2.Text.Trim();string pvalue = TextBox3.Text.Trim();string str = " if exists(select * from stuffsource where bh='"+pid+"')update stuffsource set amend='"+pvalue+"' ";string pid = TextBox1.Text.Trim();string amend = TextBox2.Text.Trim();string pvalue = TextBox3.Text.Trim();string str = " if exists(select * from stuffsource where bh='"+ pid + "') update stuffsource set " + amend" + "='" + pvalue + "'";//三个文本框不能为空或者null .net 4的版本问题 求助:刷新后获取验证码的值 session共享 关于取出库里开始日期和结束日期是一个月内的库里取记录,我这样写对嘛? 怎么在ASP.Net(C#)里操作XML?? 安装microfoft提供的一个源代码时出现 Unable to lookup local instances of SQL Server or MSDE,请指教! 1 在asp.net中如何获取鼠标的坐标? 是不是.net的bug?如何避免? 如何在WEB 服务控件输出图象 还是关于弹出窗口的问题 DirectoryEntry创建活动目录中的组织单元
如果“amend”不是表中的字段,那问题就出在这了
又亦或bh如果不是字符型就不用单引号了
string amend = TextBox2.Text.Trim();
string pvalue = TextBox3.Text.Trim();
string str = " if exists(select * from stuffsource where bh='"+pid+"')
update stuffsource set amend='"+pvalue+"' ";string pid = TextBox1.Text.Trim();
string amend = TextBox2.Text.Trim();
string pvalue = TextBox3.Text.Trim();
string str = " if exists(select * from stuffsource where bh='"+ pid + "') update stuffsource set " + amend" + "='" + pvalue + "'";//三个文本框不能为空或者null