Okay, there are a LOT of great blogs and information already out there about the BDC. So, I’m not going to reinvent the wheel here and teach you about it. I will, however, provide you with some useful links to help you get started and understand it.
I will also use this blog post as my starting point for when I forget something. :)
Getting Started – Your very first use of the BDC
First thing you have to do is download BDC Meta Man from LightningTools. Buy it if you can afford it, but the free trial is a perfect place to get you started. It generates your XML file for you and is super easy to use. You can create a quick definition with these simple steps:
- Click on “Connect to data source:” to connect to your database server
- Expand the database that contains the tables you want to use
- Drag and drop the target table onto the “Design Service”
- Click on “Build->Generate All”.
Of course this is a super simple example that just selects all the data from the given table, but it’s a great starting place for digging in and learning the BDC. After you generate your XML you need to import it into SharePoint. The following blog post from Tobias Zimmergren has a section on importing and using the xml file. It’s really easy to follow and the first part of the blog walks you through another way of creating the ADF (XML file):
Okay… so if you followed those 4 steps for BDC Meta Man and then deployed it as it says in the blog post you start to get an idea for how quick and easy it can be to do simple things using the BDC.
So, I forgot to mention that you need to add a Business Data List Web Part and connect it to your application to test it out. This is really easy to do and the blog post I mentioned from Tobias also has a great tutorial for connecting both a Business Data List Web Part and a Business Data Item Web Part. Check it out.
I’m still very much a beginner at this and don’t have a lot to offer, but here are some other things I can share:
Versioning your XML file
First lesson you need to learn, if you are modifying an existing ADF, make sure you increment the version of the file in the XML! If you don’t, the upload in Central Admin will fail:
You can either modify the XML file directly or edit the Version in the “LOB System / Instance Management” section of BDC Meta Man (Right click on the top most node of the explorer window on the bottom left of screen and click on “edit”).
Creating Filters Using BDC Meta Man
So, you probably want to add a filter and give your users some control over what they can see? Yeah, I thought so. Well, you can either figure it out and edit the XML yourself, or you can again use BDC Meta Man to do this for you.
- The windows in the bottom left of your BDC Meta Man screen should contain an tree view of all the tables you have dropped into the ‘Design Surface’. Right click on the table that you wish to filter and select “Edit”. This takes you to “Entity Management”
- Click on the “Methods” tab
- Click on “New Filter”
- Give the filter a Name
- Select the ‘Filter Type’ (Wildcard or Comparison)
- Choose the column to filter on
- Choose the Operator (choice will change depending on type of field selected)
- Enter a default value
- Click on ‘Save’
- Click on ‘Save’ again.
- Click “Build->Generate All”
- Follow the steps for uploading the the XML in Central Admin (again, make sure you implement the Version number)
There you go. How long would would this have taken you before? At least a couple seconds longer.
A Word About Authentication Mode
Well crap, I had this whole section typed up before I found that LightningTools had already done a much better job than I could:
Business Data Catalog (BDC) Authentication and Authorization
AuthenticationMode can drive you crazy if you don’t know what’s going on under the covers.
So, What Else?
Wow, this really is just the tip of the iceberg. Seriously, this is like .0005% of what you can do. There is a ton of good information on the LightningTools website. Again, I’m just getting started, but sometimes that’s the hardest part. Hopefully this will help a couple of people out there get a jumpstart in the right direction. I do want to also think Bob Fox (@bfox11b) and Tom Resing (@resing) for getting ME pointed in the right direction on this stuff. Thanks guys.