不正确的语法 [英] incorrect syntax

查看:76
本文介绍了不正确的语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中有一个错误,它显示类似Incorrecr语法的错误,靠近'',''.关于更新我的查询

I have a mistake in my project it shows the error like Incorrecr syntax neare '',''. on updating my query

(" update payment set BATCHCODE=" + textBox2.Text + ", BATCHMEMBERS=" + comboBox6.Text + ", BATCHNAME=''" + textBox10.Text + "'', COURSE=''" + comboBox5.Text + "'', BRANCH=''" + comboBox4.Text + "'', COLLEGE=''" + textBox8.Text + "'', TITLE=''" + textBox3.Text + "'', TECHNOLOGY=''" + comboBox2.Text + "'', TYPE=''" + comboBox1.Text + "'',PROJECTSTATUS=''" + comboBox3.Text + "'',DELIVERYDATE=''" + textBox9.Text + "'', PROJECTCOST=" + textBox4.Text + ", PAIDAMOUNT=" + textBox12.Text + ",PAYMENT=" + textBox6.Text + ", BALANCE=" + textBox7.Text + " WHERE REGNO=" + textBox1.Text + "");


这是我更新代码,当我添加其他字段并付款时更新字段,但是当我输入其他字段而不付款时,它不会更新.请给出拒绝


this is my code for updating when i add other field with payment the fields where updating, but when i enter other fields without payment it does''nt updating . please give sajections

推荐答案

(" update payment set BATCHCODE=" + textBox2.Text + ", BATCHMEMBERS=" + comboBox6.Text + ", BATCHNAME='" + textBox10.Text + "', COURSE='" + comboBox5.Text + "', BRANCH='" + comboBox4.Text + "', COLLEGE='" + textBox8.Text + "', TITLE='" + textBox3.Text + "', TECHNOLOGY='" + comboBox2.Text + "', [TYPE]='" + comboBox1.Text + "',PROJECTSTATUS='" + comboBox3.Text + "',DELIVERYDATE='" + textBox9.Text + "', PROJECTCOST=" + textBox4.Text + ", PAIDAMOUNT=" + textBox12.Text + ",PAYMENT=" + textBox6.Text + ", BALANCE=" + textBox7.Text + " WHERE REGNO=" + textBox1.Text + "");




我将更改标记为粗体

还请确保BATCHCODE,BATCHMEMBERS不是字符串数据类型(我的意思是nvarchar,varchar等.)




I mark my changes as a bold

also make sure that BATCHCODE , BATCHMEMBERS are not a string data type (i mean nvarchar,varchar etc....)


请确保此Dynamic SQL在字段中设置值.
例如它看起来不应该如下所示
Please make sure that this Dynamic SQL have values to set in the fields.
e.g. it should not look like as follows
update payment set BATCHCODE=, BATCHMEMBERS=, ..... 



在更新语句的列中必须分配一些值或null.



there must be some values or null to assign in the columns for a update statement.


也许您需要在sql中验证查询:
maybe you need to verify your query in sql :
<pre lang="sql">update payment set
 BATCHCODE="''" + textBox2.Text + "''",
 BATCHMEMBERS="''" + comboBox6.Text + "''",
  BATCHNAME="''" + textBox10.Text + "''",
  COURSE="''" + comboBox5.Text + "''",
  BRANCH="''" + comboBox4.Text + "''",
  COLLEGE="''" + textBox8.Text + "''",
  TITLE="''" + textBox3.Text + "''",
  TECHNOLOGY="''" + comboBox2.Text + "''",
  [TYPE]= "''" + comboBox1.Text + "''",
  PROJECTSTATUS="''" + comboBox3.Text +"''",
  DELIVERYDATE="''" + textBox9.Text + "''",
  PROJECTCOST="''" + textBox4.Text + "''",
  PAIDAMOUNT="''" + textBox12.Text + "''",
  PAYMENT="''" + textBox6.Text + "''",
  BALANCE="''" + textBox7.Text + "''"
   WHERE REGNO="" + textBox1.Text + """



这篇关于不正确的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆