Avatar of designaire
designaire
Flag for United States of America asked on

vb.net populate combobox from access database

I can't seem to populate this ComboBox from an access database. The Error is in the SQL statement. The table name is Lists and the column I want to use in the combobox is instructorList. It worked when I was using asp.net but now I have to convert it to a windows application and I can't make it work.
cnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\data.mdb;"
        cn = New OleDbConnection(cnstring)
 
        SQLstring = "SELECT * FROM Lists"
 
        Dim cmd As New OleDbCommand(cnstring, cn)
        da = New OleDbDataAdapter(cnstring, cn)
        ds = New DataSet
        da.Fill(ds, "data")
 
        combox1.DataSource = ds.Tables(0)
        combox1.DisplayMember = "data"
        combox1.ValueMember = "instructorList"

Open in new window

Visual Basic ClassicProgramming Languages-Other.NET Programming

Avatar of undefined
Last Comment
designaire

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
designaire

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy