Author: uniquealex | Posted on: 11/23/2009 3:47:42 PM | Views : 259

Hi,
 
I feeding in the data to dropdown list and trying to assign whatever the selected value is to a label. The dropdownlist gets populated correctly; however, i get wierd result, where the label always equals first value for some reason and not the selected one.
 
Please help. Here is the code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim strConnString As String = "dsn=oeslive" Dim con As New OdbcConnection(strConnString) Dim cmd As New OdbcCommand() Dim sda As New OdbcDataAdapter() Dim ds As New DataTable() cmd.CommandType = CommandType.Text cmd.CommandText = "Select stalabel from tblstatus_oes" cmd.Connection = con sda.SelectCommand = cmd Try con.Open() sda.Fill(ds) DDL.DataSource = ds DDL.DataTextF ...

Go to the complete details ...