hi,
Here is the code to connect to the database in Ms Access.
Connection string for MS Access via OLE DB:
Dim connection As OleDbConnection
connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NorthWind.mdb;User Id=;Password=;")
connection.Open();
After connecting to the database
dim da as new oledb.oledbdataadapter("select * from employees",connection)
dim ds as new dataset
da.fill(ds)
Now u can set the datas to the checked listbox.but u can assign only one column to it.
For eg
In checkedlistbox, u have a property items.
for i=0 to ds.tables(0).rows.count-1
Checkbox1.Items.Add(ds.tables(0).rows(i)(0)
next i
This will add all the rows with the first column values
Hope this helps
Regards
Exelio
Exelio
Junior Poster in Training
57 posts since Aug 2006
Reputation Points: 10
Solved Threads: 0