468,283 Members | 1,938 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,283 developers. It's quick & easy.

need help populating a listbox from a database on a webform

Hi,

I need help populating a listbox from a database on a webform.

I created a an access database with a table, fields and data. Then I
created a WebForm in vb.net and added a DropDownList control to the
page.

Then I created a data connection to my table... I right clicked and
told it to generate a dataset (which it created dataset1).

On the control, I set the properties as follows: Datasource (to
dataset1), Datamember (to the table in the database), and
DataTextField (to the field that has the data to populate the list
box). When I choose the tables and fields, it populates with the
table name and field names, so I know it's seeing the database.

However, when I run the app, the DropDownList does not populate with
any data, it's blank.

Any help would be appreciated.

Thanks,
-Chris
Jul 21 '05 #1
1 1649
Cor
Hi Cloverme.

It is always a guess without code but I think I am very much near it.
On the control, I set the properties as follows: Datasource (to
dataset1), Datamember (to the table in the database), and


datasource dataset1.table(0)
DataTextField the column to display
DataValueField the column you want to use when selected

I hope this helps

Cor
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Broder | last post: by
6 posts views Thread by Chris Leuty | last post: by
6 posts views Thread by P K | last post: by
4 posts views Thread by Seok Bee | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.