Hello. Thanks in advance.
I have several places on my site where there is a drop down list that is populated by the results of a stored procedure on SQL Server (so sproc returned list such as
Male
Female
)
and then another sproc is called to look up the info on a person and then as I check the info, I need to select the item in the list that corresponds to the value from the second sproc call.
So I call second sproc and get john doe who is marked as a male.
and I want the DDL to have Male selected. In the case where I have someone who hasn't yet had their gender selected, I want it to show nothing.
My current code (broken) to do this is:
If rdrUser.item("gender"
is system.dbnull.value Then
ddlGender.selecteditem.text = ""
Else
'figure out what they are and make the right selection
What this does is blank out the first (normally) item so my list is then just
*Blank*
Female
Is there something I should do instead of ddl.selecteditem.text = ""
Thank you again!
I have several places on my site where there is a drop down list that is populated by the results of a stored procedure on SQL Server (so sproc returned list such as
Male
Female
)
and then another sproc is called to look up the info on a person and then as I check the info, I need to select the item in the list that corresponds to the value from the second sproc call.
So I call second sproc and get john doe who is marked as a male.
and I want the DDL to have Male selected. In the case where I have someone who hasn't yet had their gender selected, I want it to show nothing.
My current code (broken) to do this is:
If rdrUser.item("gender"
ddlGender.selecteditem.text = ""
Else
'figure out what they are and make the right selection
What this does is blank out the first (normally) item so my list is then just
*Blank*
Female
Is there something I should do instead of ddl.selecteditem.text = ""
Thank you again!