O'Reilly logo

Programming ASP.NET 3.5, 4th Edition by Jesse Liberty, Dan Hurwitz, Dan Maharry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sources of Data and DataSource Controls

It may be of some comfort that the various sources of data your websites can access have not changed. They are:

  • Databases (e.g., SQL Server, Oracle, MySQL)

  • XML documents (e.g., RSS feeds, the metabase for your Internet Information Services [IIS] web server)

  • Business objects

  • Flat files (e.g., IIS logfiles, CSV files, Excel files)

In addition, the various ways provided to bind data to items on a web page remain the same as well. This chapter will concentrate on the numerous data source controls available since ASP.NET 2.0.

Tip

The name generally used to refer to the ways in which you can access and use data in ASP.NET is ADO.NET. The ADO.NET team at Microsoft is responsible for the contents of the System.Data and System.Linq namespaces.

A data source control, which is derived from the System.Web.UI.DataSourceControl class, provides a single object that you can define declaratively (in your web page) or programmatically (in your code-behind file). It will manage internally the connection to the data, its selection, and various options concerning its presentation (such as paging and caching) so that all you need to do is tell a UI control what data source to use and everything else is taken care of. In some cases, the controls also allow you to send changes to that data back to the source from which it came. The entire life cycle of the query to and response from the data source is encapsulated in this one control.

Many data source controls exist for accessing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required