I have the following code which populates a ASP.net label with values retrieved from a SP and a CachedTable:
public void UpdateDropDownList()
{
string strQue
Specialty.DataSource = distinctValues
Specialty.DataBind()
You may need to adjust the DataTextField
and DataValueField
properties, but I can't tell what those should be.
Do the same for all three dropdownlists.
I would also divide this code into separate functions. Maybe GetSpecialties
which retrieves all the specialties from the database. GetProviders
which builds the query and returns the providers from the cached table. And GetTopics
which builds that query and returns the Topics.
That would make the main function much shorter and easier to understand. As it is right now it is very hard to read.
var distinctSpecialties = GetSpecialties();
Specialty.DataSource = distinctSpecialties;
Specialty.DataBind();
var distinctProviders = GetProviders(distinctSpecialties);
Name.DataSource = distinctProviders;
Name.DataBind();
var distinctTopics = GetTopics(distinctSpecialties);
Topic.DataSource = distinctTopics;
Topic.DataBind();