compiler-errors - 这怎么了? Submit.CommandText = SQL?

昏暗的SQL作为字符串

sql = "insert into transactions (`transid`) values('" + Text1.Text + "')"
sql = sql & "; insert into customer (`custid`) values('" + Text2.Text + "')"
sql = sql & "; insert into customer (`custname`) values('" + Text3.Text + "')"
sql = sql & "; insert into transactions (`custid`) values('" + Text2.Text + "')"
sql = sql & "; insert into transactions (`serviceid`) values('" + Combo1.Text + "')"
sql = sql & "; insert into transactions (`empid`) values('" + Combo2.Text + "')"
 submit.CommandText = sql

我应该在Submit.CommandText = sql中输入什么,我听不懂这部分。请帮助我。 :)

最佳答案

看来您可以将其简化为:

sql = "insert into transactions(transid, custid, serviceid, empid) _
 values('" + Text1.Text + "','" + Text2.Text + "', '" + Combo1.Text + "', '" + Combo2.Text "');"
sql = sql + " insert into customer(custid, custname) values('" + Text2.Text + "', '" + Text3.Text + "');"

https://stackoverflow.com/questions/15697329/

相关文章:

java - 二进制搜索静态方法遇到问题无法引用

compiler-errors - JRE 抛出的 fatal error

java - Play Framework CompilationException

scala - 斯卡拉(Scala),卡斯巴(Casbah): MongoCollection.in

variables - 无法编译::I don't understand my errors. Mo

php - 在XPath评估之前,如何处理字符串中的双引号?

compiler-errors - 在NME中定位-演示项目无法转换为例如JavaScript-目标

java - 在 int 上执行方法

macos - 在MacOS上编译Irrlicht项目时出现“symbol(s) not found

sql - Qt QSql类错误