Hello,
I have got a dropdown box that is displaying data from a table in my database.
when i select an item in the list i want to change the text in a label to what has been selected in the list.
this is the code I am using to tie the dropdown list (lstNames) to my database
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = ../SR.mdb"
sql = "Select * from SRuser"
DSeS = ESDatCon.SelectData(sql, con)
lstNames.DataSource = DSeS
lstNames.DataValueField = "Uname"
lstNames.DataTextField = "Uname"
lstNames.DataBind()
End Sub
I have got this code behind the Protected Sub lstNames_SelectedIndexChanged
lblDisp.Text = lslNames.SelectedValue
However when i change the item in the list the text of the label doen't change
i have also tried
lblDisp.Text = lslNames.SelectedItem
But again nothing happens???
Anyone have any idea how to do this??
Thanks