473,545 Members | 2,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1955
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
1951
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 Format is 04.03.2004 Now I want to populate a Listbox but only with the year from that Column. So if I have lets say 10 entries with *.*.2004 and...
1
1872
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 form. It fires a stored procedure in the SQL Server Database. The listbox items are converted into a comma delimited string and sent to stored...
6
2860
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 a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access...
6
1555
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 item in the list, the list box cannot be accessed. How do I repopulate the listbox on the server after postback and be able to access the elements?
9
1862
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 direction - asc, or desc). Then, if it should be sorted, everytime an item is added to the list via Items.Add or or deleted via items.remove, I would...
1
274
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 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).
4
1362
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 listbox control. My code is as follow: ------------------------------------------- Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As...
5
2745
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 a particular school who have attended that course. They can do this in four sets of combo box (for course name) and text box (number attended)...
0
2066
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 results from that table. These list boxes work well, but they are now cluttering the screen.
0
7689
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7943
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7456
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6022
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5359
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1919
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.