How to Use the ListBox Control in ASP.NET 2.0 - Usage of the ListBox Control in web pages (Page 2 of 6 )
In an earlier article on VS2003 an example of binding a ListBox control using a DataReader was shown. ListBox can be used to display not only data from a backend database but also other kinds of lists. ListBox events can then be used for displaying list-related information. The following examples use either simple lists or data from a backend database. In the case of a backend database, however, any of the data source controls can be used. For the examples shown an AccessDataSource Control in the VS 2005 IDE is chosen.
On Using the AccessDataSource Control
The AccessDataSource control takes you the very center of RAD. Writing code is almost reduced to a single line. No more connection strings that tangle here, there and everywhere. Most of what you want to do can be done at design time. The IDE even gives you a query editor. An earlier article shows how you may use this data source control with a large number of screen shots. A few major screen shots are shown here.
Step 1You must first add a source to the data connection, which will add the nwind.mdb file on your local drive as shown in the Server Explorer window. In this picture it is shown as being refreshed.

Step 2Next you bring the connection to the App_Data folder of your website. When this is accomplished your website should appear as shown in the following picture.

Next: ListBox Examples >>
More ASP.NET Code Articles
More By Jayaram Krishnaswamy