i just found this code it was really nice, as im just a beginner i can't solve it. when i execute the code the text inside the combobox is not my database but instead a text "System.Data.DataRowView" im really newbie in vb.net im really curious how will this work. thanks in advance :)
Private Sub FillCombo()

 Try
            Dim fillcon As New OleDbConnection(conString)
            Dim asql As String = ("SELECT ItemName FROM ItemMaster ORDER BY ItemName")
            Dim da As New OleDbDataAdapter(asql, fillcon)
            Dim ds As New DataSet
            da.Fill(ds)
            ItemNameCombo.ValueMember = "ItemName"
            ItemNameCombo.DataSource = ds.Tables(0)
            ItemNameCombo.SelectedIndex = 0
        Catch ex As Exception
            MsgBox("ERROR : " & ex.Message.ToString)
        End Try
    End Sub

I believe you need to set the combobox properties in the proper order.

.DisplayMember = "Need to set this one too"
.ValueMember = "ItemName"
.DataSource =  ds.Tables(0)

Also how are you accessing the selecdt item/value when a combobox item is selected? the variables datatype needs to be the same as the valuemember's datatype.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.