Using DataSource Controls in ASP.Net

You can bind a DataBound control to a DataSource control. A DataSource control is used to represent a particular type of data.

The ASP.NET 3.5 Framework includes the following six DataSource controls:
  • SqlDataSource : Represents data retrieved from a SQL relational database, including Microsoft SQL Server, Oracle, or DB2.
  • LinqDataSource : Represents a LINQ to SQL query.
  • AccessDataSource : Represents data retrieved from a Microsoft Access database.
  • ObjectDataSource : Represents data retrieved from a business object.
  • XmlDataSource : Represents data retrieved from an XML document.
  • SiteMapDataSource : Represents data retrieved from a Site Map Provider. A Site Map Provider represents the page and folder structure of a website.
The ASP.NET Framework contains two basic types of DataSource controls. The SqlDataSource, AccessDataSource, LinqDataSource, and ObjectDataSource controls all derive from the base DataSourceControl class. These controls can be used to represent tabular data. The XmlDataSource and SiteMapDataSource controls, on the other hand, derive from the base HierarchicalDataSourceControl control. These two controls can be used to represent both tabular and hierarchical data.
A DataBound control is associated with a particular data source control through its DataSourceID property.
Tags: , , , , , , ,
Hot on Web:


About author