Joe,
First, you will need to create an OleDbDataAdapter with the query to get
the contents of the field from the table. This will populate the dataset
with a table that has a client-side representation of the data.
Then, you can set the DataSource property of the ListBox class to the
DataTable (or data set, with the name of the DataTable being set for the
DataMember property).
Once you do that, you need to set the DisplayMember property to the name
of the field on the data table which you want displayed in your listbox.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Joe Blow" <bl*****@hotmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
Folks,
I have read all the posts about databases I could find and I think I
need a little more help. I want to take all the items from a field in
an access database and use them as list items in a list box. Let's say
the listbox is called listAddress, the database is address.mdb, the
table is tblName and the field is fieldName.
Could someone give me code to populate the listbox? I only need it
populated once, I don't need to update it and don't want to update the
database.
I really appreciate any help,
Joe