I have an ASP.NET page in which a user can search via some controls. I have a dropdownlist that gets its values via a stored procedure in a SQL 2K database. This dropdownlist only has 3 values, but I would like to implement an ALL option.
if (ddlStatus.Items[ddlStatus.SelectedIndex].Value = "ALL"
{
strSQL += " A.StatusCodeID = " + ddlStatus.Items[ddlStatus.SelectedIndex].Value; ???????????????
}
else
{
strSQL += " A.StatusCodeID = " + ddlStatus.Items[ddlStatus.SelectedIndex].Value;
}
[/blue]
I just added the top statement (first strSQL), but don't know how to change it. The bottom strSQL statement is the original statement without the ALL option.
What is the best way to do this? Should I change the stored procedure or how can I change the above code to allow selecting from all 3 options?
Greatly appreciate your help.
if (ddlStatus.Items[ddlStatus.SelectedIndex].Value = "ALL"
{
strSQL += " A.StatusCodeID = " + ddlStatus.Items[ddlStatus.SelectedIndex].Value; ???????????????
}
else
{
strSQL += " A.StatusCodeID = " + ddlStatus.Items[ddlStatus.SelectedIndex].Value;
}
[/blue]
I just added the top statement (first strSQL), but don't know how to change it. The bottom strSQL statement is the original statement without the ALL option.
What is the best way to do this? Should I change the stored procedure or how can I change the above code to allow selecting from all 3 options?
Greatly appreciate your help.