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

  • Home
  • SEARCH
  • 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 7445659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:58:51+00:00 2026-05-29T11:58:51+00:00

I have a dropdownlist with following options: <asp:DropDownList ID=ddlTaxStatus runat=server OnPreRender=ddlContainerStatus_PreRender> <asp:ListItem Text=–Select– Value=-1></asp:ListItem>

  • 0

I have a dropdownlist with following options:

                                    <asp:DropDownList ID="ddlTaxStatus" runat="server" OnPreRender="ddlContainerStatus_PreRender">
                                    <asp:ListItem Text="--Select--" Value="-1"></asp:ListItem>
                                    <asp:ListItem Value="" Text="'' - Not closed"></asp:ListItem>
                                    <asp:ListItem Value="R" Text="R - Ready to pay"></asp:ListItem>
                                    <asp:ListItem Value="X" Text="X - Paid"></asp:ListItem>
                                    <asp:ListItem Value="C" Text="C - Cancel"></asp:ListItem>
                                    <asp:ListItem Value="O" Text="O - Original"></asp:ListItem>
                                    <asp:ListItem Value="D" Text="D - Delete"></asp:ListItem>
                                </asp:DropDownList>

Based on option selected by user, I send the selected option for search in my database and retrieve records which has the selected value in the related field. My Sql usp looks like this:

 ALTER PROCEDURE [dbo].[uspGetContainerSummaryRecordsForSearch] (
      @fkJobID varchar(8),
      @csmTaxStatus varchar(3)
 )
AS
  BEGIN
      SET TRANSACTION ISOLATION LEVEL SNAPSHOT
      SET NOCOUNT ON;

            SELECT fkJobID,
                      csmContainerID,
                      csmDisplayContainerID,
                      csmTaxStatus

               FROM   ContainerSummaryRecord
               where  fkJobID = @fkJobID
                      AND ( @csmTaxStatus IS NULL
                             OR csmTaxStatus = @csmTaxStatus )

  END 

Now my question, When user selects option with Value=”” and Text=”” – Not closed”, I do not get the desired result. This is because value= “” is actually stored as null in DB.
In query i am comparing input parameter in where clause like this @csmTaxStatus IS NULL
because if user has not selected any option meaning Text=”–Select–” Value=”-1″, then the filter is not applied and all the results get returned (and this is the desired behavior for this option). But this is clashing with the Value=”” which is stored as null in DB. Kindly help.

  • 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-29T11:58:52+00:00Added an answer on May 29, 2026 at 11:58 am

    change where condition as

    just make use of isnull() to resolve issue easily which replace null with blank as below

    where  fkJobID = @fkJobID                       
    AND ( @csmTaxStatus IS NULL                              
         OR isnull(csmTaxStatus,'') = @csmTaxStatus ) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following date dropdownlist options: <asp:DropDownList id=eventsDate runat=server> <asp:ListItem Value=04/31/2012>Apr 31, 2012</asp:ListItem>
I have the following in my code: <asp:DropDownList id=City runat=server> I tried using the
I have following dropdwonlists in a UserControl; <span class=src-engine-row-title-span>ADT : </span> <asp:DropDownList runat=server ID=ddlAdultTrf></asp:DropDownList>
I have the following DropDownList defined: <asp:DropDownList ID=ddlStuff CssClass=myCssClass OnSelectedIndexChanged=PopulateAnotherDropdown runat=server></asp:DropDownList> However, my PopulateAnotherDropdown
I have an ASP.NET dropdownlist like this: <asp:DropDownList ID=ddlMyDropDown runat=server> <asp:ListItem>Please pick one</asp:ListItem> <asp:ListItem>option1</asp:ListItem>
I have the following code in a view: <div class=wrap_select> @Html.DropDownList(dateRange, new SelectList(Model.DateRange, Value,Text),
I have a DropDownList with the following options: o select 1 hot 2 cold
I have the following: HTML <select class=dropDownList id=PersonFunction> <option value=>Choose</option> <option value=1>Vice President</option> <option
How to access the asp.net dropdownlist selecteditem value from javascript? I have the following
i have the following code in an asp.net mvc view. <% = Html.DropDownList(Filter, new

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.