We have customised sharepoint templates. Whenever user creates new site BDC List webpart should automaticaly create to the new site. For that I need to write code to display BDC list data.
I want to add BusinessDataListWebPart Programmaticaly to the site. I have following code but i don't know how to add Business Data Type Application to the webpart using code.
BusinessDataListWebPart webPart = new BusinessDataListWebPart();
SqlSessionProvider.Instance().SetSharedResourceProviderToUse("SharedServices1");
NamedLobSystemDictionary lobSystems = ApplicationRegistry.GetLobSystems();
foreach (LobSystem system in lobSystems.Values)
{
NamedLobSystemInstanceDictionary instances = system.GetLobSystemInstances();
foreach (LobSystemInstance instance in instances.Values)
{
Console.WriteLine(instance.Name);
if (instance.Name == "BDCTestInstance")
{
}
}
}
Do you know someone who can help? Share a link to this thread on twitter, or facebook.