昏暗的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
最佳答案
看来您可以将其简化为:
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/
相关文章:
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-目标