SPDataSourceView Class

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


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

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class SPDataSourceView : DataSourceView

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.

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