Click here to Skip to main content
12,401,158 members (60,029 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


19 bookmarked

how to create a database connection for the Business Data Catalog in Microsoft Office SharePoint Server 2007

, 6 Jan 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
An easy way to connect external database in sharepoint using Business Data Catalog


The Business Data Catalog feature of Microsoft Office SharePoint Server 2007 provides an easy way to integrate business data from back-end server applications. You register business data exposed in databases or through Web services in the Business Data Catalog by creating metadata that describes the database or Web service. The Business Data Catalog then uses this metadata to make the right calls into the data source to retrieve the relevant data. The objective of this article access the LOB application’s data through BDC and display it in the Sharepoint site inside the Business Data Lists Webpart. To generate LOB we can use different tools like Microsoft business Data Catalog Definition Editor for Microsoft office SharePoint server 2007 or BDCMetaMan.  The BDCMetaMan is not free but Microsoft business Data Catalog Definition Editor is free.

What is Problem with Microsoft business Data Catalog Definition?

When we generate LOB with Microsoft BDC Editor it does not generate Method instance “Finder” but it does not show up in the list when trying to add it to a Business Data list. We have to add “Finder” method instance to XML file manually. After adding “Finder” it will show BDC in Business Data type Picker. 

Start Writing the BDC Metadata in XML

Metadata is an XML file. Start writing xml, In this we start with LobSystem tag. LobSystem tag define the namespace , The name of the LOB System, the type of system Database or web service.


 <LobSystemInstance Name="Test1" >


 <Property Name="rdbconnection Data Source" Type="System.String">SMTSRV01</Property>

 <Property Name="rdbconnection Initial Catalog" Type="System.String">Test</Property>

 <Property Name="rdbconnection Integrated Security" Type="System.String">SSPI</Property>

 <Property Name="DatabaseAccessProvider" 

 <Property Name="AuthenticationMode"

 <Property Name="RdbConnection Pooling" Type="System.String">false</Property>



Now, create an entity and define its properties.

<Entity EstimatedInstanceCount="100" Name="Product">


<Property Name="Name" Type="System.String">Name</Property>



<Identifier Name="ProductID" TypeName="System.String" />


There should be a method that gets the details of the entity based on the input parameters.  The following tags define a method called “FindProducts” which has a query tha t gets the name and productid of the products entity based on the entered productid. Also the input parameter is defined using the parameter tag with Direction attribute as “In”. The output is the product entity having two members namely name and productid which is defined in the parameter tags with the Direction attribute as “Return”.


 <Method Name="FindProducts">


 <Property Name="RdbCommandText" Type="System.String">

 SELECT ProductID, Name,Price FROM Product WHERE ProductID = @ProductID


 <Property Name="RdbCommandType" Type="System.Data.CommandType">Text</Property>



 <FilterDescriptor Type="Comparison" Name="ProductID">


 <Property Name="Comparator" Type="System.String">Equals</Property>





 <Parameter Direction="In" Name="@ProductID">

 <TypeDescriptor TypeName="System.String" IdentifierName="ProductID"
    AssociatedFilter="ProductID" Name="ProductID">


 <DefaultValue MethodInstanceName="ProductFinderInstance"
    Type="System.String" > 1 </DefaultValue>




 <Parameter Direction="Return" Name="Products">

 <TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.3600.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089"

 IsCollection="true" Name="ProductDataReader">


 <TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.3600.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089"



 <TypeDescriptor TypeName="System.String" IdentifierName="ProductID" Name="ProductID">


 <LocalizedDisplayName LCID="1033">ProductID</LocalizedDisplayName>


  <TypeDescriptor TypeName="System.String" Name="Price">


 <LocalizedDisplayName LCID="1033">Price</LocalizedDisplayName>



 <TypeDescriptor TypeName="System.String" Name="Name">


 <LocalizedDisplayName LCID="1033">Name</LocalizedDisplayName>



 <Property Name="DisplayByDefault" Type="System.Boolean">true</Property>









Now create an instance fof the “FindProducts” method..


 <MethodInstance Name="ProductFinderInstance" Type="Finder"
    ReturnParameterName="Products" />


The complete metadata code is as follows:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<LobSystem xmlns:xsi=<a href=""></a>
/office/2006/03/BusinessDataCatalog BDCMetadata.xsd
" Type="Database" Version="" Name="Test" 

After writing LOB we have to Import this to Sharepoint web site.

  • Go to the central administration and select your SSP.


  • Browse your metadata file and click “Import”


  • A warning message will come. Click “Ok”.

    Now, go to your Sharepoint site and click “Edit Page” under Site Actions

  • Click “Add a Web Part”
  • Select the “Business Data List” Web Part under Business Data and click Add
  • In the newly added Business Data List Web Part click Edit and select Modify Shared Web Part
  • In the type textbox, click Browse


  • In the Business Data Type Picker dialog box, select your BDC file and click Ok.

Now the Webpart will look like the following.





This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer SmartBuzz
India India
I am software engineer.I am working on Microsoft Technologies. Currently working in,,,DotNetNuke and Microsoft Office Sharepoint Server 2007 (MOSS). I am Microsoft Certified in Dot net Framework.

You may also be interested in...

Comments and Discussions

QuestionWhat tool do use to create ADF file? Pin
Member 1477851-Dec-11 18:17
memberMember 1477851-Dec-11 18:17 
GeneralAwesome Pin
Vivek27946-Jan-09 19:35
memberVivek27946-Jan-09 19:35 
GeneralFantastic Pin
Manvindersingh6-Jan-09 18:07
memberManvindersingh6-Jan-09 18:07 
GeneralCool Pin
Abhijit Jana6-Jan-09 17:56
mvpAbhijit Jana6-Jan-09 17:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160721.1 | Last Updated 6 Jan 2009
Article Copyright 2009 by Ranjitpl
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid