Add the following Project References to your project:
- Microsoft.SharePoint
- Microsoft.SharePoint.Portal
- Microsoft.Office.Server
Tell the System which Shared Service Provider to use:
SqlSessionProvider.Instance().SetSharedResourceProviderToUse(SharedServiceProviderName);
Load Application Definition File (BDC) into a stream:
FileStream xmlStream = new FileStream("C:/MYLOB.xml", FileMode.Open, FileAccess.Read);
ParseContext parseContext = new ParseContext();
Import the Package:
ApplicationRegistry.Instance.ImportPackage(xmlStream, parseContext, PackageContents.Model | PackageContents.Properties | PackageContents.Permissions | PackageContents.LocalizedNames);