Click to See Complete Forum and Search --> : adding an option to an asp:DropDownList


pelegk1
12-19-2005, 05:06 PM
i have an asp:DropDownList which get its data like this :

cmdSelect = New SqlCommand("Select * From course_type", conPubs)

course_type.DataSource = cmdSelect.ExecuteReader()
course_type.DataValueField = "course_id"
course_type.DataTextField = "course_name"
course_type.DataBind()

how can i add in the first option of the select box my own option before the ones that are added using the databind?
thnaks in advance
peleg

juicemousezero
12-19-2005, 05:40 PM
Man this problem is hitting a lot of folks today. Anyway, just toss this in.


ddlName.Items.Insert(0, "-- Select Some Stuff --")