What is DataSource Control?

Data Source Control is a programming component for connecting to different type of data.

  • It acts like mediator between databound [gridview,datalist,...] controls and datasources.
  • Data Source Controls are:
  1. LinqDataSource
  2. EntityDataSource
  3. ObjectDataSource
  4. SqlDataSource
  5. AccessDataSource
  6. XmlDataSource
  7. SiteMapDataSource

LinqDataSource:

Enables you to use Language-Integrated Query (LINQ) in an ASP.NET Web page through declarative markup in order to retrieve and modify data from a data object. Supports automatic generation of select, update, insert, and delete commands. The control also supports sorting, filtering, and paging.

EntityDataSource:

Enables you to bind to data that is based on the Entity Data Model (EDM). Supports automatic generation of update, insert, delete, and select commands. The control also supports sorting, filtering and paging.

ObjectDataSource:

Enables you to work with a business object or other class and create Web applications that rely on middle-tier objects to manage data. Supports advanced sorting and paging scenarios unavailable with the other data source controls.

SqlDataSource:

Enables you to work with Microsoft SQL Server, OLE DB, ODBC, or Oracle databases. When used with SQL Server, supports advanced caching capabilities. The control also supports sorting, filtering, and paging when data is returned as a DataSet object.

AccessDataSource:

Enables you to work with a Microsoft Access database. Supports sorting, filtering, and paging when data is returned as a DataSet object.

XmlDataSource:

Enables you to work with an XML file, especially for hierarchical ASP.NET server controls such as the TreeView or Menu control. Supports filtering capabilities using XPath expressions and enables you to apply an XSLT transformation to the data. The XmlDataSource allows you to update data by saving the entire XML document with changes.

SiteMapDataSource:

Used with ASP.NET site navigation.