Have a drop down list that is populated using a stored procedure, however instead of the first value constantly showing I would like to have a default value saying "Please select" not sure how i do this though.

Recommended Answers

All 2 Replies

drpdownlist.Items.Insert(0, New ListItem("--Please Select--", String.Empty))

There are various methods. Here is a similar question posted on the asp.net forum:
http://forums.asp.net/t/1287909.aspx/1

You could even do this within SQL (not that I would recommend this approach), by creating a UNION with the other SELECT statement.

SELECT dropDownFieldData FROM table1 UNION SELECT '--Please Select--'
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.