Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DropDownList Populated from Database 2

Status
Not open for further replies.
Yes, one method would be to actually add it to the data source itself (i.e. in the SQL). Alternatively, add a row to the DataTable (or whatever data control you are using) before binding.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks guys for the help. Got me pointed in the right direction. Here's what I came up with:

Code:
ddlCity.DataSource = SqlDataSourceJobs
            SqlDataSourceJobs.SelectCommand = "SELECT DISTINCT jobCity FROM jobs"
            ddlCity.DataBind()
            ddlCity.Items.Insert(0, "")
            ddlCity.Items.Insert(1, New ListItem("All", "*"))
            ddlCity.SelectedIndex = 0

Thanks again for the help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top