search blog
most popular
MCP MCTS MCT MVP

SharePoint BDC Part 1: Getting Started with the Business Data Catalog 

Author: Tobias Zimmergren
URL: http://www.zimmergren.net | http://www.tozit.com 

Introduction

In this article I will guide you through the very basics of getting started with Business Data Catalog, BDC:

  1. Install the AdventureWorks 2008 Sample Databases
    1. We will use this database as our example for retrieving data using the BDC.
  2. I will step you through the simple process of creating your ADF (Application Definition File)
    1. We will use this file as our import connection
  3. I will guide you through how we can import this ADF file and create our BDC Application
  4. Lastly, I will guide you through the process of creating a basic site and use some of the basic BDC Web Parts

Install the AdventureWorks sample database

  • You'll need to go and download the AdventureWorks sample databases
    image

  • Just finish the installation by clicking next a couple of times and let the installer do it's normal Microsoft-installer magic.
  • You should now see a couple of new databases in your SQL Server Management Studio:
    image
    AdventureWorks, AdventureWorks2008, AdventureWorksDW, AdventureWorksDW2008, AdventureWorksLT, AdventureWorksLT2008

Alright - We've got our databases, now we need to start thinking about how we will get data from our SQL server into SharePoint. This is done by creating/generating an Application Definition File (ADF) as you will see in the next section.

Creating the ADF (Application Definition File)

Alright, there's a few different options to create your ADF (Application Definition File). I will show you how to get started with using the free tool called "Application Definition Editor" that comes with the latest SharePoint Server SDK.

Note: See the bottom section in this article for a summary of links to all resources mentioned in the article.

After you have installed the latest SDK, you can choose to install the "Microsoft BDCTool" located here by default: "C:\Program Files\2007 Office System Developer Resources\Tools\BDC Definition Editor". Which will give you the following item in your Start Menu:
image

Launch the BDC Application Definition Designer

Click the application and launch the editor. You will see an interface like this:
image

Create or import your ADF file

There's basically two alternatives when it comes to editing an ADF (Application Definition File).
One is to create a new one (which I will guide you through first), and the other is to import an existing one (which I will show you after the first alternative).

Alt 1) Creating our own ADF file
Now we're going to connect to our newly created sample-databases and create an ADF file for use with those databases.
  • Click on ADD LOB System
  • Choose Connect To Database
  • You will see a nice popup-dialog where you will be able to enter the connection details to your desired database
    • Enter your connection details, example:
       image
  • You are presented with the "Designer Surface" that looks something like this:
    image
  • In our case, we're going to use the table called "vEmployee" which exist in the AdventureWorks database in order to pull out some information about our employees.
    • Search for the table called vEmployee and drag it out to the Design Surface
    • Search for the table called vEmployeeDepartments and drag it out to the Design Surface
    • It should look something like this:
      image
    • Make any necessary changes, then click OK
    • You'll see a view similar to this one after some tweaking:
      image 
    • After you've done the necessary changes to your configuration, making sure it's a valid ADF with proper filters, enumerators and methods or whatever you need in your application then smile, because we're done with that part!
Alt 2) Importing an existing ADF file

If you don't want to do everything from scratch or you've already got an ADF file that you wish to modify, you can do so by importing an existing ADF file into the Definition Editor. Here's how:

  • Open the BDC Definition Editor tool, then click the "Import" button in the menu:
    image
  • Browse to your existing ADF file and choose to import it. Simple as that.
    (I am importing a file called BDCAWDW.xml, which contains definitions for Product, Reseller, ProductSubcategory, ProductCategory as shown below)
  • You'll see the imported ADF file's structure immediately in the designer, under the prerequisite that your SQL connection string in the ADF file is valid:
    image 

Note: I will not detail how you create filters, finders, methods etc. in this article. You can read more about that here:
http://msdn.microsoft.com/en-us/library/ms145931(SQL.90).aspx

I may cover the topic of ADF-functionality in another article later on.

Generate the ADF file from the designer

I really don't need to tell you this, but there's a button called "Export" which you use to export the definition you've created using the definition editor to an xml file:
image

Import the ADF file

If we have gotten this far, we might as well get the last few bits in place.
What we now need to do is to import our ADF file into SharePoint, since that's where it should reside. Follow along with these few simple steps to make sure you're properly importing your file into SharePoint.

  • Navigate to your Shared Services Provider Administration site (You can access your SSP through Central Administration)
  • You are presented with a section called "Business Data Catalog" where you'll find a bunch of different alternatives.
  • Make sure you have the permissions to modify the BDC (See the link Business Data Catalog permissions)
  • Click "Import application definition"
    image  
  • Browse for your .xml file and click "OK":
    image
  • You'll see a progress bar (You don't see that a lot in SharePoint. I love it!), telling your how the import process is going:
    image
  • When it's done, you'll click "OK" and be presented with an overview of your imported BDC Application:
    image
Configure permissions on the BDC Application Definition

In order for all users to be able to select/read data from your BDC Application, you'll need to make sure they've got the appropriate permissions to actually do so.

Usually I do this setting on each of the imported entities, in case you want specific permissions on different entities - instead of on the entire application.

  • Select the DropDown list on your first entity and choose "Manage Permissions":
    image 
  • Choose "Add Users/Group":
    image
  • Enter "NT AUTHORITY\AUTHENTICATED USERS" and choose "Select in Clients":
    image
  • Repeat these steps for the other entity as well.
  • You're done.

Now we have created or imported an ADF file with the Business Data Catalog Definition Editor tool, exported it to an .xml file, imported it into SharePoint, set basic permissions on the entities.

Next, we should make sure that the application works in SharePoint by adding a Business Data Catalog-WebPart to a page.

Use the basic built-in BDC Web Parts

Awesome. Now that we have gotten this far by importing an ADF file into SharePoint and set appropriate permissions on the entities - We're ready to actually use the ADF connection to view stuff in our database.

Note: I have created a new blank site where I can easily show the built-in BDC Web Parts - so that's where I am adding my Web Parts.

 

  • Add two Web Parts to your page called "Business Data List" and "Business Data Item":
    (Note that when you've configured a BDC application, you'll see the Business Data web parts)
    image
  • Choose to edit the properties of the Business Data List Web Part:
    image
  • Click the Browse-icon to the right to pop up the BDC entity chooser:
    image
  • It will present you with the following interface (note, BDC applications will of course vary depending on what you have imported..):
    image 
  • Double click the "Employee" type, and then click "OK" in your Web Part property window.
  • Repeat this process for the "Business Data Item" Web Part, and select "Employee" in the BDC Type Picker as well.

Now we've got one BDC List Web Part which will list all employees, and one BDC Item Web Part that will display details about the employee we select.

In order for this to work we must connect the two Web Parts.

  • Edit menu of your Web Part -> Connections -> Send Selected item To -> Employee
    image

Test our BDC Application out, and make sure it works!

  • Choose "LastName" then "contains" and enter "smith":
    image
  • Select one of the results by clicking the radiobutton to the left, and see that the result (details) about the Employee shows up in the connected Web Part:
    image 

Resources and links

Summary

This article is a basic step-by-step guide to getting started with BDC in MOSS 2007. I've shown you every step from creating the databases required (in our case some sample databases) to creating the ADF file and to finally utilize the BDC connection from a site, using the BDC Web Parts.

In an upcoming post I will talk about how you can create your own BDC Web Parts! Keep your eyes open!

 
Posted on 25-Jun-09 by Tobias Zimmergren
35 Comments  |  Trackback Url  |  Link to this post | Bookmark this post with:        
Tags: BDC, MOSS 2007, How To, SharePoint
 

Links to this post (Trackbacks/Pingbacks)

Comments

Thursday, 25 Jun 2009 03:17 by Adam
Super easy to follow. Excellent stuff!

Thursday, 25 Jun 2009 04:19 by Anonymous
ther we go. pictures back;). good post

Friday, 26 Jun 2009 08:51 by Roger Nilsson
Oh come on, this is great stuff man. i like the pedagogical vains in you (: - keep up the heavy articles

Monday, 29 Jun 2009 12:32 by Javier
this is good article about bdc. can provide some details on how use other tools like metaman or other things on bdc would be really nice

Monday, 29 Jun 2009 01:29 by Jayvardhan Patil
Tried, had few issues initially but finally achieved. Really good stuff, will wait for next episodes. Selected this article as "Sharepoint tweet of the day!". Jayvardhan Patil http://codeforfutue.com Follow http://twitter.com/codeforfuture for "useful" sharepoint links everyday.

Monday, 29 Jun 2009 04:16 by Yazid
Excellent Article, however, I cannot see the WebParts clled "Business Data List" and "Business Data Item": and hence I cannot add them. Thanks Yaz

Monday, 29 Jun 2009 04:40 by Yazid
Excellent Article, however, I cannot see the WebParts clled "Business Data List" and "Business Data Item": and hence I cannot add them. Thanks Yaz

Monday, 29 Jun 2009 05:33 by Yazid
Excellent Article, however, I cannot see the WebParts clled "Business Data List" and "Business Data Item": and hence I cannot add them. Thanks Yaz

Tuesday, 30 Jun 2009 03:10 by Whoa
GREAT! brilliant. i just followed and got it working immediately after some database tweaks with permissions. THANKS BIGTIME TOBIAS

Tuesday, 7 Jul 2009 06:03 by miles
I forsee BDC making a huge comeback! This is honestly the best feature with MOSS. For me, I was able to integrate my library system with this! If interested I can explain more.

Monday, 13 Jul 2009 10:13 by Thomas Algrave
Looks like you put a lot of efforts into your articles here. Looks great, thanks for sharing this information. Excellent help!!

Wednesday, 15 Jul 2009 10:18 by Martin Edelius
Very nice article and just what I needed. Thanks a lot!

Monday, 20 Jul 2009 12:15 by Bert Svensson
good article. love the fact that you get very detailed posts out here every time. always great to read this. thank you!!

Monday, 27 Jul 2009 03:18 by Jaydip Das
Excellent! Thank you very much for the details!

Thursday, 6 Aug 2009 09:17 by BINU
tHIS IS THE EASYEST ARTICLE I EVER SEEN IN THE INTERNET.THANK YOU!

Thursday, 6 Aug 2009 12:59 by Tobias Zimmergren
Wow people. Thanks for all the response. Glad you liked it. Check out Part 2.

Tuesday, 11 Aug 2009 03:49 by Erik Decker
this is probaly the best and most concrete article i have read the last 6 months all-over! goood info and good overview of how it works. step-by-step-zimmer is back. i (we, our company) appreciate all your hard work in this blog. we have this as our team-startpage. keep up the work, and hope to see you in Las Vegas if i can make it there

Wednesday, 12 Aug 2009 07:05 by suresh
good to follow, but i had an issue, my business data type picker is showing nothing, any idea?

Wednesday, 12 Aug 2009 10:12 by Jim
Question, why are my Business Data webparts not showing up? I imported the file and set permissions but when I go to site and click add web part, i do not get the Business Data web parts. Thanks,

Monday, 17 Aug 2009 10:57 by Tobias Zimmergren
If you don't see the BDC Web Pars it's probably because you havn't activated the MOSS Enterprise features that needs to be enabled in order to access those Web Parts

Tuesday, 18 Aug 2009 08:04 by agusto xapverius
Great article, i will tested in my sharepoint and put in too into my blog.

Monday, 24 Aug 2009 03:03 by Frank
If you don't have MOSS Enterprise, if you want to have REAL lists (no web parts) connected to your external LOB data, please try BDLC: 1. Enter Connectio String 2. Enter Select statement 3. Enter primary keys directly in the list settings. Thats it! All list features available, including workflows if external data changes.

Wednesday, 16 Sep 2009 01:39 by Toni
gread article! or as u would say: awesome!

Tuesday, 22 Sep 2009 06:57 by Nancy
For some reason my install of the MS Application Definition Designer is failing at the the last step. Any known issues I might look at?

Wednesday, 7 Oct 2009 10:00 by wow
wow. good tutorlial

Friday, 16 Oct 2009 09:11 by Peter Scholten
I can't thank you enough for such a great post.. direct to the point, and easy to follow.. One question though, if you don't mind.. So after I get through importing the .xml file into SS, why is it when I add a web part, the Business Data Item can find the Catalog Type that I just created, but the Business Data List web part does not?

Tuesday, 17 Nov 2009 03:44 by XT
I am having the same problem as the guy above me. The Data Business List web part is not showing the Catalog Type while the Business Data Item has no problem finding it... Any solutions to this?

Saturday, 21 Nov 2009 02:37 by Ofer Gal
I see many people have the problem of the BDC showing fine in the SSP but can't see it in the main site. Any one found a solution?

Wednesday, 23 Dec 2009 06:16 by Brian Chisolm
SOLUTION: For the problem people are having with the Catalog type not showing up in the BD List web part. By default, the Microsoft Application Definition Designer does not create a method instance compatible with this type of web part. The easiest solution is before you export the ADF, navigate to Entities > Methods > FindAll_xxx > Instances > FindAll_xxx. In the properties windows, change "MethodInstanceType" from "IdEnumerator" to "Finder". Now proceed as instructed and the BD List web part will recognize it.

Wednesday, 23 Dec 2009 06:50 by Brian Chisolm
SOLUTION: For the problem people are having with the Catalog type not showing up in the BD List web part. By default, the Microsoft Application Definition Designer does not create a method instance compatible with this type of web part. The easiest solution is before you export the ADF, navigate to Entities > Methods > FindAll_xxx > Instances > FindAll_xxx. In the properties windows, change "MethodInstanceType" from "IdEnumerator" to "Finder". Now proceed as instructed and the BD List web part will recognize it.

Name:
URL:
Email:
Comments: