Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Advanced Search

Advanced Search

Scheduled Pinned Locked Moved C#
databasehelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arslanjatt
    wrote on last edited by
    #1

    Hi guys I've a form for cars search. There are different text boxes and check boxes on that form. User can even enter one field or all the field or no one field. If i use and operator then it doesen't give me any result. can anybody help me. How can i make a query that can give me result. for example i want to search the cars which have cdplayer. now all the fields are empty only one check box is checked.

    N 1 Reply Last reply
    0
    • A arslanjatt

      Hi guys I've a form for cars search. There are different text boxes and check boxes on that form. User can even enter one field or all the field or no one field. If i use and operator then it doesen't give me any result. can anybody help me. How can i make a query that can give me result. for example i want to search the cars which have cdplayer. now all the fields are empty only one check box is checked.

      N Offline
      N Offline
      nateraaaa
      wrote on last edited by
      #2

      How are you performing your search? Are you using a stored procedure? If so you will need to allow your parameters to be null. Pass all of your fields on the form to your search proc. If one of the fields is blank pass a null value for that parameter. This way you can do a specific search on only the criteria that is selected by the user. I have also done a search page that will allow the user to select Any in a drop down list. The proc then replaces a parameter with the value Any with a * (to search all items in the drop down list). Hope this helps. Nathan

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups