How listbox read data from Microsoft Access

h0T

Member
Joined
Jun 21, 2004
Messages
15
Programming Experience
Beginner
hi everyone i'm currently facing the problem of how listbox read data from microsoft access
Pls show me some code coz as i try to find it in MSDN Library.. nothin was found.. :-(

Thank in advance
 

h0T

Member
Joined
Jun 21, 2004
Messages
15
Programming Experience
Beginner
PLs Help

SOS

PS : Havent start any code yet
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
The standard listbox doesn't "read data from microsoft access". Here's a link to an MSDN article that shows how to create a databound listview control: Creating a Data Bound ListView Control

A listView is more appropriate for showing tables of data. The listbox would suffice if you only had one column of data to display.
 

bloukewer

Well-known member
Joined
Jul 2, 2004
Messages
88
Programming Experience
3-5
1. Create a connection
2. Create a data-adapter
3. Create a dataset
4. Lets say the Dataset's name is 'DS1', it contains a table called 'tab1' and a column named 'col1' :

listbox.datasource = DS1
listbox.DisplayMember = "tab1.Col1"


To my knowledge, only ONE Column can be bound to a Listbox at a time. The procedure above also applies to Comboboxes, which is often more effective.
 
Top Bottom