• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 869
  • Last Modified:

What is the Statement Continuation Character in C#?

For readability, I would like to continue a statement on the next line.  I've tried the '&_' like so:

string striMyquery= "select distinct  a.item, b.cat from products a  '&_'
                                      inner join prodcategories b on a.item = b.item";

this give  a syntax error.  Thanks in advance
0
BoggyBayouBoy
Asked:
BoggyBayouBoy
1 Solution
 
josgoodCommented:
Terminate the string and then use Plus sign, as in

string striMyquery= "select distinct  a.item, b.cat from products a  '&_'" +
                               "inner join prodcategories b on a.item = b.item";

Added closing quote and plus sign to first line.
Added beginning quote to second line
0
 
BoggyBayouBoyAuthor Commented:
Thanks!!!!!!
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
more options:
http://navaneethkn.wordpress.com/2007/09/19/writing-a-long-string-in-multiple-lines-c/


string striMyquery= @"select distinct  a.item, b.cat from products a  
                                      inner join prodcategories b on a.item = b.item";

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now