Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: escape?

  1. #1
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,924
    Thanks
    46
    Thanked 203 Times in 202 Posts

    escape?

    This is probably the wrong forum for this; but asp.net is not specifically C# and it relates to connecting to my server and there is usually not too much traffic on the asp.net page...
    my question. In setting up my connection string for my DB there is an instance of "COMPUTERNAME\Dstuff" which C# recognizes as an escape (\D) sequence.
    Does anyone know the proper way to display the \D as literally \D and not an escape? I tried using ' around it- I also thought there was a trick with @... I'm stuck
    Last edited by alykins; 06-15-2011 at 10:09 PM.

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    alykins (06-15-2011)

  • #3
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,924
    Thanks
    46
    Thanked 203 Times in 202 Posts
    Quote Originally Posted by abduraooft View Post
    Thanx for that- not quite what I was looking for, but nice to know that I also have to ahndle escape sequences in my tSQL lang... The more specific code I was looking for I finally found buried in a C# book-
    For C#
    for any interested if you have a \b (or some other escape/expression) yo can make the compiler see it as literal bu placeing @ before it; so eg if I have string blah= "\n bingo";
    and I do not want the compiler to recognize \n as "new line"
    you would phrase it
    string blah: @"\n bingo";
    ... again- not sure this should be in here; but nice to know the info about SQL having escapes/expression paths as well)

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •