0

I have a drop down menu

 <asp:DropDownList ID="ddlUser" runat="server" CssClass="form-

control" AppendDataBoundItems="True" DataSourceID="SqlDataSource2" 

DataTextField="Person" DataValueField="PersonID" 

OnSelectedIndexChanged="ddlUser_SelectedIndexChanged" AutoPostBack="True">

        <asp:ListItem>Select User</asp:ListItem>

        </asp:DropDownList>

        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="

<%$ ConnectionStrings:IBS_6 %>" SelectCommand="SELECT DISTINCT PersonID, PLName 

+ ' 

    ' + PFName + ',' + PMoNo AS Person, PFName, PLName, PMoNo, PEmail, PArea, 

PCity, PAge, PGender, PType, PStatus, dbTstamp FROM tbl_persons ORDER BY 

dbTstamp DESC"></asp:SqlDataSource>

if the value of any fields of file 'PMoNo' is blank or null then dropdown menu's item's display is blank. Howere the value of the item comes I can select the blank item.

enter image description here

1 Answer 1

2

If PfMoNo is null, then also PfName + ‘,’ + PfMoNo is null, so DropDown sees Person null and does not display text. You should use COALESCE(PfMoNo,‘’) instead of PfMoNo

Sign up to request clarification or add additional context in comments.

1 Comment

This helped. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.