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:
A DataBound control is associated with a particular data source control through its DataSourceID property.
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.
A DataBound control is associated with a particular data source control through its DataSourceID property.
A hierarchical DataBound control can be used to display nested data items. For example, you can use hierarchical DataBound controls to display the folder and page structure of the contents of an XML file, or a set of master/detail database records.
Hierarchical DataBound controls:
Hierarchical DataBound controls:
- Menu : Displays data items in a static or dynamic menu.
- TreeView : Displays data items in a tree.
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.
You use DataBound controls to generate your application’s user interface for working with data. The DataBound controls can be used to display and edit database data, XML data, or just about any other type of data.
- BulletedList : Displays a bulleted list of items. Each item can be displayed as text, a link button, or a hyperlink.
- CheckBoxList : Displays a list of check boxes. Multiple check boxes in the list can be selected.
- DropDownList : Displays a drop-down list. Only one item in the drop-down list can be selected.
- ListBox : Displays a list box. You can configure this control so that only one item in the list can be selected or multiple items can be selected.
- RadioButtonList : Displays a list of radio buttons. Only one radio button can be selected.