What is the Statement Continuation Character in C#?

Posted on 2008-11-08
Last Modified: 2012-06-27
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, from products a  '&_'
                                      inner join prodcategories b on a.item = b.item";

this give  a syntax error.  Thanks in advance
Question by:BoggyBayouBoy
    LVL 13

    Accepted Solution

    Terminate the string and then use Plus sign, as in

    string striMyquery= "select distinct  a.item, 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
    LVL 1

    Author Closing Comment

    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    more options:

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

    Open in new window


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now