In this chapter, we looked at ASP.NET's support for databound controls. While it's not rocket science to iterate through a collection and add the data to ASP.NET's server-side controls, it's a fairly common operation. That Microsoft pushed it down into the Framework classes is a good thing.
One of the advantages of these controls is that they don't care at all where their data comes from. The data might be as simple as an ArrayList composed of .NET types (with each element in the array representing a row and each property representing a column). On the other hand, the data bound to a control might be as complex as IDataReader or a DataSet acquired from a physical database.
Looking at databound controls invariably involves mentioning the ASP.NET database story: ADO.NET. The ADO.NET managed classes are for connecting to the database, commanding the database, and harvesting the results afterward. While connecting to the database manually (via .NET 1.x-style code) is still supported, .NET version 2.0 and Visual Studio 2005 offer an easier way to associated controls with data via the DataSource controls.
ASP.NET includes a number of databound controls that may be matched up with a collection or (in the case of certain DataSource controls) a data source. The controls then assume the burden of iterating through the data and rendering the correct tags to the client.