HI,
I have a databound drop down list. It gets the data from the SQL db fine, but when selecting a new choice the .selecteditem never changes. So if it loads A,B,C,D the selected item is always A no matter what I select. Code below, thanks for the help.
This binds it:
con.Open()
txtVCP.DataSource = com.ExecuteReader
txtVCP.DataTextField = "VCP"
txtVCP.DataBind()
con.Close()
All the data is fine
Private Sub txtVCP_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtVCP.SelectedIndexChanged
Dim vcp As String
vcp = txtVCP.SelectedItem.Value
End Sub
VCP always = A, no matter whats selected.
I have a databound drop down list. It gets the data from the SQL db fine, but when selecting a new choice the .selecteditem never changes. So if it loads A,B,C,D the selected item is always A no matter what I select. Code below, thanks for the help.
This binds it:
con.Open()
txtVCP.DataSource = com.ExecuteReader
txtVCP.DataTextField = "VCP"
txtVCP.DataBind()
con.Close()
All the data is fine
Private Sub txtVCP_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtVCP.SelectedIndexChanged
Dim vcp As String
vcp = txtVCP.SelectedItem.Value
End Sub
VCP always = A, no matter whats selected.