vb.net中延续到下一行的SQL语句错误

vb.net中延续到下一行的SQL语句错误,sql,vb.net,winforms,Sql,Vb.net,Winforms,下面是SQL语句,我想继续到下一行,但它在value子句中显示错误,我实际上想把语句分成多行 sqlstr = "insert into pos_invoice_hdr(invoice_no, loc_code, invoce_type, invoice_date, cust_code, gross_amt, disc_percent, net_amt, doctor_code, loose_qty, pkt_qty, remarks, ccy, card_no, card_type

下面是SQL语句,我想继续到下一行,但它在value子句中显示错误,我实际上想把语句分成多行

sqlstr = "insert into       pos_invoice_hdr(invoice_no, loc_code, invoce_type, invoice_date, cust_code, gross_amt, disc_percent, net_amt, doctor_code, loose_qty, pkt_qty, remarks, ccy, card_no, card_type, invoice_by) _"
    "values("@invoice_no, @loc_code, @invoice_type, @invoice_Date, @cust_code, @gross_amt, @disc_percent, @net")"

语句的输入参数比表中预期的少

16个字段

(invoice_no, 
 loc_code, 
 invoce_type, 
 invoice_date, 
 cust_code, 
 gross_amt, 
 disc_percent, 
 net_amt, 
 doctor_code, 
 loose_qty, 
 pkt_qty, 
 remarks, 
 ccy, 
 card_no, 
 card_type, 
 invoice_by) _"
values
8个值

("@invoice_no, 
@loc_code, 
@invoice_type,
@invoice_Date, 
@cust_code, 
@gross_amt,
@disc_percent,
@net")"
您需要删除以下字段

doctor_code, 
     loose_qty, 
     pkt_qty, 
     remarks, 
     ccy, 
     card_no, 
     card_type, 
     invoice_by

或者添加更多值。

您尝试过类似的方法吗

sqlstr = "insert into pos_invoice_hdr(invoice_no, loc_code, invoce_type,   invoice_date, cust_code, gross_amt, disc_percent, net_amt, doctor_code, loose_qty, pkt_qty,  remarks, ccy, card_no, card_type, invoice_by)" & _
     "values(@invoice_no, @loc_code, @invoice_type, @invoice_Date, @cust_code,   @gross_amt, @disc_percent, @net)"
差不多

 Dim str as string 
       str = "first string" & _
           "second string"

尝试在第二行的开头添加“&”。不同的VS版本允许使用不同的方法来进行基本行的延续,但是对于应该有效的字符串,您可能不需要在第二个括号中使用额外的引号line@plutonix:它仍然不工作,给出语法error@angelo它显示蓝色波浪线。。。实际上,我想通过添加一个连续字符将语句分成多行您使用的语言是什么?我已经删除了额外的字段,但我想知道如何继续到下一行它显示蓝色波浪线。。。实际上,我想通过添加一个连续字符将语句分成多行