Results 1 to 4 of 4

Thread: [RESOLVED] @-quoting

  1. #1

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Resolved [RESOLVED] @-quoting

    In a system we're developing admin users can add users to the system. So i would add a user such as "Domain\fishcake" and then check to see if that user already exists.

    However the value of txtAccount.text = @"Domain\fishcake" and when passed in as a parameter to a stored procedure to check if it's a duplicate it returns false even if "Domain\fishcake" is in there.

    How can i get around this?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: @-quoting

    If the stored procedure is doing all the work, then I think we would need to see what is happening there.

  3. #3
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: @-quoting

    \ -- is an escape character in C#. You would need to prefix any string that needs \ with an @ sign.

    So when you pass it to a stored procedure you should be prefix it with @ there also.

    Can you post the code how you are calling the stored procedure and how you are adding the parameter.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  4. #4

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: @-quoting

    Cheers guys, sorted it.

Posting Permissions

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



Click Here to Expand Forum to Full Width