By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,363 Members | 3,622 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,363 IT Pros & Developers. It's quick & easy.

need help populating a listbox from a database on a webform

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.