I have the below codes to populate a combo box and getting Value Member as Vend_cd after combo box selected index change. My problem is a want two values as a Value Member, as i know combo box have single display member and value member. I also know i can conconate two columns and can used as a display member or may be as value member too.
I want to get unit alongwith vend_cd after combobox selected index change event.
How can i do this. Please advise.
Dim dataset As New DataSet
Dim adapter As New SqlDataAdapter()
adapter.SelectCommand = New SqlCommand("select distinct vend_item.vend_Cd,vend_item.Unit,vendor.vend_name from vend_item inner join vendor on vend_item.vend_cd=vendor.vend_Cd where vend_item.item_cd in (" + selectedVendor.ToString + ")", myconn)
If myconn.State = ConnectionState.Closed Then myconn.Open()
CmbVendor.DataSource = dataset.Tables(0)
CmbVendor.DisplayMember = "Vend_name"
CmbVendor.ValueMember = "Vend_cd"