SPDataSource.GetView method (String)

Gets a specified view as an DataSourceView object.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

protected override DataSourceView GetView(
	string viewName


Type: System.String

The name of an SPDataSourceView object.

Return value

Type: System.Web.UI.DataSourceView
A System.Web.UI.DataSourceView object that represents the specified data view.


The argument is not the value of the DefaultViewName field.

You can enumerate through the set of views currently associated with the data source control by calling the GetViewNames() method. Because the SPDataSource class supports only one data source view, the GetViewNames method returns a collection that contains only one name, the value of the DefaultViewName field.