Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

List box value member

prospect22prospect22 Member Posts: 11
Hi.

I have 2 populated list boxes on my VB.NET form and need to add the displayed values from each to my database based on the value member not the display member. Each list box is populated from a seperate data table and I have found that the below method does not work (as the variable rob returns the value"class_id":

Dim rob
rob = lstClass.valueMember

This returns the value "class_id" because above lines read:

daLicenceClass.Fill(dtLicenceClass)
lstClass.DataSource = dtLicenceClass
lstclass.valueMember = "class_id"

Can anyone help?

Thanks in advance.
Sign In or Register to comment.