SPListDataSource Class
Provides information about an external list.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
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.
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)
- 9/17/2010
- Brent Groom
- 9/17/2010
- Brent Groom
http://pholpar.wordpress.com/2010/08/23/creating-external-lists-from-code/
- 8/23/2010
- Peter Holpar