running32
asked on
Displaying value member
In the code below I wanted to display the strAssistanceDesc in the combo box but have the lngAssistanceid as the value that is reterived. this code is displaying 1 which is the lngAssitanceid, how can I get it to display the name instead.
thank you
Dim cmd6 As New SqlClient.SqlCommand("Sele ct * from tbllkpMHCPAssistance", Connection1)
Try
cmd6.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Dim da As New SqlDataAdapter(cmd6)
Dim ds As New DataSet
da.Fill(ds, "tbllkpMHCPAssistance")
me.ComboBox5.DataSource = ds.Tables("tbllkpMHCPAssis tance")
Me.ComboBox5.DisplayMember = "strAsstistanceDesc"
Me.ComboBox5.ValueMember = "lngAssistanceid"
thank you
Dim cmd6 As New SqlClient.SqlCommand("Sele
Try
cmd6.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Dim da As New SqlDataAdapter(cmd6)
Dim ds As New DataSet
da.Fill(ds, "tbllkpMHCPAssistance")
me.ComboBox5.DataSource = ds.Tables("tbllkpMHCPAssis
Me.ComboBox5.DisplayMember
Me.ComboBox5.ValueMember = "lngAssistanceid"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
running32,
You use ComboBox5.SelectedValue to return the valuemember associated with the item.
Tim
You use ComboBox5.SelectedValue to return the valuemember associated with the item.
Tim
ASKER