Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Add BDC List webpart to sharepoint site using code

  Asked By: Shasta Fry         Date: Aug 07, 2008      Category: Sharepoint      Views: 306
 

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.

Tagged:                  

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Add BDC List webpart to sharepoint site using code Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].