buenagente33
New member
- Joined
- Sep 27, 2008
- Messages
- 1
- Programming Experience
- 1-3
Im having trouble with a drop down list on an asp.net application.
The drop down list binds data from a database, but when I run it, if I want to select the first value, I have to choose some other value then go back to the first one to be able to select it.
Does anyone know how to add a "Select Value" fiels that points to nothing so that I can choose the first value without choosing another one first?
Here is the code:
Any help would be appreciated
The drop down list binds data from a database, but when I run it, if I want to select the first value, I have to choose some other value then go back to the first one to be able to select it.
Does anyone know how to add a "Select Value" fiels that points to nothing so that I can choose the first value without choosing another one first?
Here is the code:
VB.NET:
Public Sub FillOutcomeDropDown()
Dim DataReader As SqlClient.SqlDataReader
Me.SqlConnection.Open()
Me.SqlCommandSelectOutcome.Parameters("@OutcomeProgram").Value = Me.ProgramDropDownList.SelectedValue
DataReader = Me.SqlCommandSelectOutcome.ExecuteReader()
Me.OutcomeDropDownList.DataSource = DataReader
Me.OutcomeDropDownList.DataTextField = "OutcomeDescription"
Me.OutcomeDropDownList.DataValueField = "OutcomeCode"
Me.OutcomeDropDownList.DataBind()
DataReader.Close()
Me.SqlConnection.Close()
End Sub
Any help would be appreciated