Results 1 to 3 of 3

Thread: Search record using like operator

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    54

    Search record using like operator

    I have developed an application in VB2008/MySql as MySQl connector.I did serach record method but i need serach record using wild charcters i.e. like operator(S%,%S).Have a look at the normal search record code .
    For Each de In myHT
    If de.Value.ToString() <> "" Then
    If iCount = 1 Then
    searchquery = "select date,PartNo,Customer,Requestor,Quotes,SO,WO,Vendor,Quantity,Turn,price,Lot,layers,x,y,Thick,Material ,MinLine,Minspace,MinDrill,ViaFill,impedence,plating,PacDesign,comments from quotes where"
    searchquery = searchquery + " " + de.Key + "=" + "'" + de.Value.ToString() + "'"
    iCount = iCount + 1
    Else
    searchquery = searchquery + " " + "And" + " " + de.Key + "=" + "'" + de.Value.ToString() + "'"
    End If
    End If
    Next

  2. #2
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: Search record using like operator

    I think you should have something like this:
    Code:
    SELECT * FROM [YourTable] WHERE [YourColumn] LIKE '&#37;" & searchStr & "%'

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    54

    Re: Search record using like operator

    Yes i am looking like but it should be added to above stated code

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