E
Ed Bick
I added items to a listbox as follows:
Dim datDrivers As New SqlConnection(SQL_CONNECTION_CB)
Dim adpDrivers As New
SqlDataAdapter(MySelectStatement,datDrivers)
adpDrivers.Fill(DriverData, DRIVER_TABLE_NAME)
lstDrivers.DataSource = DriverData.Tables(DRIVER_TABLE_NAME)
lstDrivers.DisplayMember = "Name"
lstDrivers.ValueMember = "DriverID"
I am trying to retrieve the value assigned by this
lstDrivers.ValueMember = "DriverID"
By using a statement like this
Dim strDriverID As String = lstDrivers.SelectedItem.ToString
But all I'm getting is this
System.Data.DataRowView (the value displayed in watches for strDriverID)
What am I doing wrong?
Dim datDrivers As New SqlConnection(SQL_CONNECTION_CB)
Dim adpDrivers As New
SqlDataAdapter(MySelectStatement,datDrivers)
adpDrivers.Fill(DriverData, DRIVER_TABLE_NAME)
lstDrivers.DataSource = DriverData.Tables(DRIVER_TABLE_NAME)
lstDrivers.DisplayMember = "Name"
lstDrivers.ValueMember = "DriverID"
I am trying to retrieve the value assigned by this
lstDrivers.ValueMember = "DriverID"
By using a statement like this
Dim strDriverID As String = lstDrivers.SelectedItem.ToString
But all I'm getting is this
System.Data.DataRowView (the value displayed in watches for strDriverID)
What am I doing wrong?