0

I want to put or cut my string into couple of lines. How could I do that? this is the line of codes I want to cut (but they are still in string).

sql = "INSERT INTO tblClientInfo (genClientID, fullName, address, comaker, colateral, atmPIN, principal, "
                & "interest, principalInWords, terms, interestPerMonth, principalperMonth, totalPayment, interestPercentage, "
                & " interestBal, principalBal, theDate, totalBal)"

This code returns an error. What is the proper way of concatenation or cutting a long string?

4

2 に答える 2

2

次のように、各行の末尾にスペースとアンダースコアを付けて、行が次の行に続くことを示す必要があります。

sql = "INSERT INTO tblClientInfo (genClientID, fullName, address, comaker, colateral, atmPIN, principal, " _
  & "interest, principalInWords, terms, interestPerMonth, principalperMonth, totalPayment, interestPercentage, " _
  & " interestBal, principalBal, theDate, totalBal)"

追加の参照: http://msdn.microsoft.com/en-us/library/aa711641%28v=vs.71%29.aspx

于 2013-02-22T03:20:06.037 に答える
0

String.Concat()行継続のアンダースコアもアンパサンドも必要ないので気に入っています。すっきり見えるだけ。

sql = String.Concat( 
    "INSERT INTO tblClientInfo (genClientID, fullName, address, comaker, colateral, atmPIN, principal, ",
    "interest, principalInWords, terms, interestPerMonth, principalperMonth, totalPayment, interestPercentage, ",
    "interestBal, principalBal, theDate, totalBal)" )
于 2013-02-22T03:24:27.507 に答える