System.Web.UI.WebControls.DataBoundControl.GetDataSource Method

Retrieves the System.Web.UI.IDataSource interface that the data-bound control is associated with, if any.

Syntax

protected virtual System.Web.UI.IDataSource GetDataSource ()

Returns

An System.Web.UI.IDataSource that represents the data source identified by DataBoundControl.DataSourceID.

Remarks

The DataBoundControl.GetData method calls the DataBoundControl.GetDataSource method internally. A valid System.Web.UI.IDataSource instance is retrieved by these two methods and is cached by the System.Web.UI.WebControls.DataBoundControl object until the DataBoundControl.OnDataPropertyChanged method signals that the data source has changed.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0