Compartilhar via


SPDataSource.GetView Method (String)

Gets a specified view as an DataSourceView object.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Protected Overrides Function GetView ( _
    viewName As String _
) As DataSourceView
'Usage
Dim viewName As String
Dim returnValue As DataSourceView

returnValue = Me.GetView(viewName)
protected override DataSourceView GetView(
    string viewName
)

Parameters

Return Value

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

Exceptions

Exception Condition
ArgumentException

The argument is not the value of the DefaultViewName field.

Remarks

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.

See Also

Reference

SPDataSource Class

SPDataSource Members

GetView Overload

Microsoft.SharePoint.WebControls Namespace

GetViewNames()