gridview select command question

Discussion in 'ASP .Net' started by Tammy B, Mar 6, 2006.

  1. Tammy B

    Tammy B Guest

    Hi!

    I have the following select command:
    SelectCommand="SELECT [id], [Name], [Address1], [Address2], [CITY], [STATE],
    [ZIP], [COUNTRY] from [MyTable] WHERE ([Address1] = @txtAddress1)"

    I would like to be able to use a LIKE operator rather than EQUALS

    I can't figure it.

    Can you help?

    THANKS!!!!
     
    Tammy B, Mar 6, 2006
    #1
    1. Advertising

  2. Hi,
    you can use

    SelectCommand="SELECT [id], [Name], [Address1], [Address2], [CITY], [STATE],
    [ZIP], [COUNTRY] from [MyTable] WHERE ([Address1] LIKE '%' + @txtAddress1
    +'%' )"

    It would work fine...

    Best wishes
    Munawar Hussain




    "Tammy B" <> wrote in message
    news:...
    > Hi!
    >
    > I have the following select command:
    > SelectCommand="SELECT [id], [Name], [Address1], [Address2], [CITY],
    > [STATE], [ZIP], [COUNTRY] from [MyTable] WHERE ([Address1] =
    > @txtAddress1)"
    >
    > I would like to be able to use a LIKE operator rather than EQUALS
    >
    > I can't figure it.
    >
    > Can you help?
    >
    > THANKS!!!!
    >
    >
     
    Munawar Hussain, Mar 7, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFiYmxlcg==?=

    select gridview row without using select button?

    =?Utf-8?B?RGFiYmxlcg==?=, Mar 3, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    101,631
    dch31969
    Feb 27, 2009
  2. sanam
    Replies:
    0
    Views:
    541
    sanam
    Aug 9, 2008
  3. MikeS
    Replies:
    4
    Views:
    355
    MikeS
    Nov 16, 2006
  4. palmiere
    Replies:
    1
    Views:
    469
    Erwin Moller
    Feb 9, 2004
  5. Bonge Boo!
    Replies:
    5
    Views:
    230
    Bonge Boo!
    Apr 25, 2005
Loading...

Share This Page