System.Web.UI.DataSourceControl.GetView Method

Gets the named data source view associated with the data source control.

Syntax

protected abstract DataSourceView GetView (string viewName)

Parameters

viewName
The name of the System.Web.UI.DataSourceView to retrieve. In data source controls that support only one view, such as System.Web.UI.WebControls.SqlDataSource, this parameter is ignored.

Returns

Returns the named System.Web.UI.DataSourceView associated with the System.Web.UI.DataSourceControl.

Remarks

You can enumerate through the set of views currently associated with the data source control by calling the DataSourceControl.GetViewNames method.

Data source control classes can support one or more views on their underlying data. These views are represented by instances of the System.Web.UI.DataSourceView class. The data source view defines the capabilities of a data source control, does all the work necessary to retrieve data from the underlying data store, and performs operations such as sorting, inserting, deleting, and updating.

Note:

The System.Web.UI.DataSourceControl class's default implementation returns null. If you extend the System.Web.UI.DataSourceControl class, override the DataSourceControl.GetView(string) method to return the specified System.Web.UI.DataSourceView object.

Requirements

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