0

将 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 中输入什么,我无法理解这部分内容。请帮帮我。:)

4

1 回答 1

0

看起来您可以将其简化为:

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 + "');"
于 2013-03-29T04:37:38.457 回答