Hi All, i am new to vb.net and hope i could get some help here. I want to display the product no and the product name both together in the combobox from a table using a dataset. So in the list i would see something like this " 01 Sugar " where 01 is product code and sugar is product name. I am using the following codes but i can only display either of the one. how can i display both field together.
Try
sqlconn.Open()
Dim x As String = "select * from products"
Dim sqladpt As New SqlDataAdapter(x, sqlconn)
Dim sqlds As New DataSet
sqladpt.Fill(sqlds, "Products")
With ComboBox1
.DataSource = sqlds.Tables("Products")
.DisplayMember = "Product Name"
.ValueMember = "Product No"
.SelectedIndex = 0
End With
thanks in advance
Try
sqlconn.Open()
Dim x As String = "select * from products"
Dim sqladpt As New SqlDataAdapter(x, sqlconn)
Dim sqlds As New DataSet
sqladpt.Fill(sqlds, "Products")
With ComboBox1
.DataSource = sqlds.Tables("Products")
.DisplayMember = "Product Name"
.ValueMember = "Product No"
.SelectedIndex = 0
End With
thanks in advance