none
How To write <Script> </Script> in C# RRS feed

  • Question

  • how following statement like vb program can be written C#

    string SqlCdm = <Script>

    select * from employee

    where id = 1

    </Script>

     

    rather than

    string sqlcmd = "select * from employee"+

                           " where id = 1"

    Tuesday, September 21, 2010 5:01 AM

Answers

  • I believe you could use following format in C#

    string sqlcmd = @"select * from employee

     where id = 1"


    Val Mazur (MVP) http://www.xporttools.net
    • Proposed as answer by VMazurModerator Thursday, September 23, 2010 10:22 AM
    • Marked as answer by Sushil Agarwal Friday, September 24, 2010 3:45 PM
    Wednesday, September 22, 2010 10:17 AM
    Moderator

All replies

  • It is not clear what you are trying to achieve. Could you please post more details about what exactly you need to do?
    Val Mazur (MVP) http://www.xporttools.net
    Tuesday, September 21, 2010 10:22 AM
    Moderator
  • Dear VMazur,

    For writing Long SQL  Queries ic C# i have to start query with quotes (") and each line is to be closed by (") follwed by (+),  

    if i have to test/modify this query in SSMS i need to remove all " & + sign this is quote labors & also error prone in hurry time

    in vb.net  i can write simply

    <Script>

    My query

    </Script>

    i wanted same thing in c# , 

    masters can u help me to solve this.

    Thanks

    Sushil Agarwal

    Wednesday, September 22, 2010 5:33 AM
  • I believe you could use following format in C#

    string sqlcmd = @"select * from employee

     where id = 1"


    Val Mazur (MVP) http://www.xporttools.net
    • Proposed as answer by VMazurModerator Thursday, September 23, 2010 10:22 AM
    • Marked as answer by Sushil Agarwal Friday, September 24, 2010 3:45 PM
    Wednesday, September 22, 2010 10:17 AM
    Moderator