0 out of 1 rated this helpful - Rate this topic

SPListDataSource Class

SharePoint 2010

Provides information about an external list.

System.Object
  Microsoft.SharePoint.SPListDataSource

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
[SubsetCallableTypeAttribute]
[ClientCallableTypeAttribute(Name = "ListDataSource", ServerTypeId = "{06bfe4a5-1516-4b55-a6d7-ecbe3ff7a3c8}", 
	ValueObject = true)]
public sealed class SPListDataSource

This class serves as the bridge between SPList and an external list. Use the associated SPList to retrieve entity fields and data.

Retrieve an instance of SPListDataSource from the HasExternalDataSource property. When HasExternalDataSource is not null, the SPList object's data is external to Microsoft SharePoint Foundation.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
PS Example delete/create an external list

Add-PsSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$url = "http://gr06"
$destWeb = get-SPweb($url) #delete a list
$destWeb.Lists.Delete($destWeb.Lists["Oracle Scott"].ID)

#setup the BDC data source
#http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistdatasource.bdcproperties_members.aspx
$bdcsource = New-Object Microsoft.SharePoint.SPListDataSource$bdcsource.SetProperty("LobSystemInstance", “Oracle Sys Instance 2”)
$bdcsource.SetProperty("EntityNamespace", “Microsoft.Lobi.OracleModel”)
$bdcsource.SetProperty("Entity", “employee”);
$bdcsource.SetProperty("SpecificFinder", “EmployeeSpecificFinderInstance”);

#http://msdn.microsoft.com/en-us/library/ee542908.aspx
$newlistid = $destWeb.Lists.Add("Oracle Scott","","Lists/Oracle Scott",$bdcsource)

Creating external lists from code
You can use the SPListDataSource class to create external lists in SharePoint by binding an external content type to the list. See my blog post for code examples as well for my experience with that code
http://pholpar.wordpress.com/2010/08/23/creating-external-lists-from-code/