Results 1 to 5 of 5

Thread: [RESOLVED] [2005] dataset query with @ literal

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Resolved [RESOLVED] [2005] dataset query with @ literal

    I have a query that actually needs to use an @ sign in a literal ... where lastName not like '@%'. of course .net thinks this is supposed to be a parameter, is there a way to do this in the table adapter designer?

    I'm looking for data where the lastname does not start with an @ sign, and would like to build a dataset off of this.

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [2005] dataset query with @ literal

    I think you can use the escape characters to do that. I can't remember the syntax for VB.Net but I think it's something like this:
    Code:
    WHERE lastName NOT LIKE '"@%'
    Alternatively Chr(64) may work.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Resolved Re: [2005] dataset query with @ literal

    Quote Originally Posted by kasracer
    I think you can use the escape characters to do that. I can't remember the syntax for VB.Net but I think it's something like this:
    Code:
    WHERE lastName NOT LIKE '"@%'
    Alternatively Chr(64) may work.
    This appears to work, thank you!

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Re: [2005] dataset query with @ literal

    Quote Originally Posted by Deepak Sakpal
    Use Chr(Asc("@"c)) like this:

    MessageBox.Show("""" & Chr(Asc("@"c)) & "%""")
    This doesn't work in the designer, the other post worked though.

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