ADO.NET 101: Data Rendering with a DataList Control Introduction
(Page 1 of 5 )
This how-to tutorial describes displaying the data from a DataReader using the DataList Iterative data bound control. In an earlier tutorial, how to display data using the data bound RepeaterControl was described. Although this tutorial is self-contained, the reader will find it helpful to review the earlier tutorials covering ADO.NET.
The iterative RAD technique described in this tutorial offers flexible, free form formatting of displayed data. When the controls are bound to a data source, the three controls Repeater, DataList, and DataGrid loop through the data row-by-row, and apply a rendering template (html) on a row by row basis. The free formatting offers a great deal of flexibility, although it requires some effort to configure the control.
For fast retrieval of data from a database, the DataReader is unbeatable. However it is only suited for the Read-only, Forward-only type of data retrieval. The iterative controls can fire specialized events. In this tutorial we are only looking at binding the data to the DataReader and configuring the control.
Iterative ControlsThe following picture shows the three controls in the VS 2003 IDE's toolbox. The DataList and DataGrid icons show intuitively that they are related to data.

What makes the DataList such a flexible tool is the large number of properties and methods available for the designer, as seen in the following class view for DataList.

Next: Displaying Data from DataReader with a DataList Control >>
More Database Articles
More By Jayaram Krishnaswamy