DataFormWebPart.GetDataSource method

Gets the data source that the DataFormWebPart is displaying data for.

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

Syntax

'Declaration
Public Overridable Function GetDataSource As IDataSource
'Usage
Dim instance As DataFormWebPart
Dim returnValue As IDataSource

returnValue = instance.GetDataSource()
public virtual IDataSource GetDataSource()

Return value

Type: System.Web.UI.IDataSource
The data source that the DataFormWebPart is displaying data for.

Remarks

This method gets the data source using the DataSourceID.

This method returns the first element in DataSources if the DataSourceID is an empty string.

This method throws an exception if a control with DataSourceID cannot be found or the control is not an IDataSource.

See also

Reference

DataFormWebPart class

DataFormWebPart members

Microsoft.SharePoint.WebPartPages namespace