The tabular DataBound controls are the main set of controls that you use when working with database data. These controls enable you to display and, in some cases, modify data retrieved from a database or other type of data source.
There are six tabular DataBound controls. These controls can be divided into two types: those that display multiple data items at a time and those that display a single data item at a time.
Following controls to display a set of data items:
There are six tabular DataBound controls. These controls can be divided into two types: those that display multiple data items at a time and those that display a single data item at a time.
Following controls to display a set of data items:
- GridView : Displays a set of data items in an HTML table. For example, you can use the GridView control to display all the records contained in the Movies database table. This control enables you to display, sort, page, select, and edit data.
- DataList : Displays a set of data items in an HTML table. Unlike the GridView control, more than one data item can be displayed in a single row.
- Repeater : Displays a set of data items using a template. Unlike the GridView and DataList controls, a Repeater control does not automatically render an HTML table.
- ListView : Displays a set of data items using a template. Unlike the Repeater control, the ListView control supports sorting, paging, and editing database data.
- DetailsView : Displays a single data item in an HTML table. For example, you can use the DetailsView control to display a single record from the Movies database table. This control enables you to display, page, edit, and add data.
- FormView : Uses a template to display a single data item. Unlike the DetailsView, a FormView enables you to layout a form by using templates.
ASP.NET 2.0 enables a declarative solution for data binding which requires no code at all for the most common data scenarios, such as:
Data Source Controls:
Data source controls have no rendering, but instead represent a particular backend data store, for example a database, business object, XML file, or XML Web Service. Data source controls also enable rich capabilities over data - such as sorting, paging, filtering, updating, deleting, and inserting - that data-bound UI controls can automatically use. ASP.NET includes the following server controls out-of-the-box
Data Bound controls are UI controls that render data as markup to the requesting client device or browser. A data-bound control can auto-bind to data exposed from a data source and will fetch data at the appropriate time in the page request lifecycle. These controls can optionally take advantage of data source capabilities such as sorting, paging, filtering, updating, deleting, and inserting. A data-bound control connects to a data source control through its DataSourceID property. You may be familiar with some of the data-bound controls in ASP.NET v1.x, such as DataGrid, DataList, Repeater, and list controls like DropDownList. ASP.NET 2.0 contains several new data-bound controls as well, such as:
- Selecting and displaying data
- Sorting, Paging and Caching Data
- Updating, Inserting and Deleting Data
- Filtering or Master-Details Using Parameters
Data Source Controls:
Data source controls have no rendering, but instead represent a particular backend data store, for example a database, business object, XML file, or XML Web Service. Data source controls also enable rich capabilities over data - such as sorting, paging, filtering, updating, deleting, and inserting - that data-bound UI controls can automatically use. ASP.NET includes the following server controls out-of-the-box
- SqlDataSource : Enables binding to a SQL database represented by an ADO.NET provider, such as Microsoft™ SQL Server, OLEDB, ODBC, or Oracle.
- ObjectDataSource : Enables binding to a middle-tier object such as a data access layer or business component.
- AccessDataSource : Enables binding to a Microsoft™ Access (Jet) database.
- SiteMapDataSource : Enables binding to the hierarchy exposed by an ASP.NET 2.0 site navigation provider.
- XmlDataSource : Enables binding to an XML file or document.
Data Bound controls are UI controls that render data as markup to the requesting client device or browser. A data-bound control can auto-bind to data exposed from a data source and will fetch data at the appropriate time in the page request lifecycle. These controls can optionally take advantage of data source capabilities such as sorting, paging, filtering, updating, deleting, and inserting. A data-bound control connects to a data source control through its DataSourceID property. You may be familiar with some of the data-bound controls in ASP.NET v1.x, such as DataGrid, DataList, Repeater, and list controls like DropDownList. ASP.NET 2.0 contains several new data-bound controls as well, such as:
- GridView : Renders data in a grid format. This control is an evolution of the DataGrid control, and can automatically take advantage of data source capabilities.
- DetailsView : Renders a single data item in a table of label/value pairs, similar to the form view in Microsoft™ Access. This control can also automatically take advantage of data source capabilities.
- FormView : Renders a single data item at a time in a form defined by a custom template. Renders a single data item in a table of label/value pairs, similar to the form view in Microsoft™ Access. This control can also automatically take advantage of data source capabilities.
- TreeView : Renders data in a hierarchical tree view of expandable nodes.
- Menu : Renders data in a hierarchical dynamic menu