Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6737807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:17:31+00:00 2026-05-26T11:17:31+00:00

I have a search function de build. We are using pure ASP.NET w\ VB.NET

  • 0

I have a search function de build.
We are using pure ASP.NET w\ VB.NET

We have multiple DropDownLists and we’re building a search query with whatever was selected in those DDLs. My question is, how can I handle the blank values (unselected dropdownlist values) with the SQL Query ? I’m using AND operators in the query so if anything is blank it’ll fail the search. If the dropdownlist has no selected value, i don’t want the value to be part of the search. It would be easy to code with just 2-3 parameters, but we’re looking thru at least 10 items and doing a SWITCH CASE or multiple IFs would soon become mayhem.

I’m sure there’s an easier solution out there.

Thanks for the help
Have a nice day folks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:17:32+00:00Added an answer on May 26, 2026 at 11:17 am

    I guess you could default the parameters to NULL in the sproc and do something like

    ...
    Where 
    (someField1 = @Param1 OR @Param1 IS NULL) AND
    (someField2 = @Param2 OR @Param2 IS NULL) AND
    (someField3 = @Param3 OR @Param3 IS NULL) ....
    

    etc

    That way, if you pass NULL, that particular check will be true.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem using the Java search function in Eclipse on a particular
What is the best way to handle the following database search scenario using asp.net
I am using jQuery UI Autocomplete to build a search interface. I have defined
I have an asp.net web page with a simple search text box that returns
if i have a search function for my site and i want the user's
I have an active directory search function: Function GetAdInfo(ByVal ADDN As String, ByVal ADCommonName
How can i have slide downeffect? The effect will be similar with search function
hai I have a magento web site. In this the search function compare with
I have a function that uses Pattern#compile and a Matcher to search a list
I have the following code in my .Zshrc function google; { $VIEW http://www.google.com/search?q='url-encode ${(j:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.