Partager via


SPDataSourceView Class

Supports the SPDataSource control and provides an interface for data-bound controls to perform operations against Windows SharePoint Services data.

Inheritance Hierarchy

System.Object
  System.Web.UI.DataSourceView
    Microsoft.SharePoint.WebControls.SPDataSourceView

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

Syntax

<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class SPDataSourceView _
    Inherits DataSourceView

Dim instance As SPDataSourceView
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class SPDataSourceView : DataSourceView

Remarks

The SPDataSourceView class implements the data functionality that is exposed by the SPDataSource control. At run time, one SPDataSourceView object is created for each instance of the SPDataSource class.

Page developers should access the SPDataSourceView object only indirectly, through the associated SPDataSource object. For example, when page code sets the SelectCommand property of an SPDataSource object, the SPDataSource object passes the value on to the SelectCommand property of the associated SPDataSourceView object. Conversely, when a data-bound control calls the Select method of an SPDataSourceView object, the SPDataSourceView object calls the OnSelecting method of its associated SPDataSource object, which then raises the Selecting event. Page developers can handle the event by overriding the OnSelecting method.

Data-bound control developers must have direct access to the SPDataSourceView object. For example, code in a data-bound control might call the DataBoundControl.GetData() method to retrieve a SPDataSourceView object from the associated data source control, and then call the Select method of the SPDataSourceView object to retrieve the data.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPDataSourceView Members

Microsoft.SharePoint.WebControls Namespace