473,400 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

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 1942
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Broder | last post by:
Hi there, I am currently running into a somewhat weired problem and hope that this NG is able to help ;-) I have a table in a MSSQL Server in which there is one Column that stores a date. The...
1
by: Chris | last post by:
Hi, I have an application written in ASP and I am converting to ASP.NET in the old ASP page users can add items to a listbox control. When the user hits the "submit" command button on the...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
6
by: P K | last post by:
I have a listbox which I am populating on the client (it contains a list of dates selected from calender). The listbox is a server control. When I get to the server after postback by selecting an...
9
by: James Radke | last post by:
Hello, I would like to create a sorted listbox which has one property that I can set to true or false to show if the listbox should be sorted (I may potentially add another one for the sort...
1
by: cloverme | last post by:
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...
4
by: Seok Bee | last post by:
Dear Experts, I am having 1 listbox control in my web form and trying to retrieve the items and load into it. I want to list out those uploaded files into the database and list out in the...
5
JustJim
by: JustJim | last post by:
Well this has been fun, but I now elect to "phone a friend" I have an Access application in which the operator can enter/choose the name of a training course and enter the number of teachers from...
0
by: redpears007 | last post by:
Morning all! :) I have a database with multiple linked tables. I have created a search form with one txt box, for entering search criteria, and a listbox for each of the tables to isplay the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.