Business Connectivity Servi

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Business Connectivity Services (BCS) Creating an External Content Typ...

http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...

A-PDF Watermark DEMO: Purchase from www.A-PDF.com to remove the watermark

1 of 9

Clayton's SharePoint Madness

da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n

All About SharePoint, InfoPath, and SharePoint Designer!


Home
SharePoint 2010
Blog Request Log
Contact

View my MCP Certifications

My Categories

Top Posts

InfoPath - Get user information without writing code (extended)


InfoPath 2010 Rules!
Blog Listing

Recent Posts
MSDN Forums SharePoint Task Force A Call to Arms!
InfoPath 2010 Designing External List Forms
Business Connectivity Services (BCS) Creating an External List from an ECT
Business Connectivity Services (BCS) Creating an External Content Type (ECT) based on a SQL 2008 Table
SharePoint 2010 Update 1 Infrastructure Setup: Single Server Farm
Having Trouble Activating Windows 7 RTM?
InfoPath Copy SharePoint List Data to Main Data Source
InfoPath User Roles in Browser-Enabled Forms Using AD Groups
InfoPath 2010 Rules!
Using [ME] to Filter InfoPath Form Views Based on Form Metadata

9/26/2010 3:30 AM

Business Connectivity Services (BCS) Creating an External Content Typ...

2 of 9

http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...

Archive

da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n

August 2010 (1)


October 2009 (3)
August 2009 (3)
July 2009 (2)
June 2009 (6)

Blog Stats

92,768 hits

Blogroll

Ben Peters
InfoPathDev
Spence Harbar
Tidbit on the Bits

Subscribe

Entries (RSS)
Comments (RSS)

Tags

7 64-bit active

directory auto-number automatic filename browser browser-enabled browser

Contact Selector GetCommonMemberships


permissions Qdabra.com qrules

forms

GetUserProfileByName group memberships ID infopath InfoPathDev moss Office 2010

roles security security groups

sharepoint

SharePoint 2010

SharePoint Designer SP2010 SQL 2008

UserProfileService user roles W2K8R2 Win7 Windows7 Windows 7 Windows Server 2008 R2 Word 2010 Workflow

SharePoint 2010 Update 1 Infrastructure Setup: Single Server Farm


Business Connectivity Services (BCS) Creating an External List from an ECT

Business Connectivity Services (BCS) Creating an External Content Type


(ECT) based on a SQL 2008 Table
Posted by Clayton Cobb on October 25, 2009
Rate This
Let the SharePoint 2010 Madness begin! My first post-NDA blog entry will be about the new Business Connectivity Services
(BCS), which replaces the Business Data Catalog (BDC). The purpose of the BCS (and formerly BDC) is to expose business
data from non-SharePoint data sources within your SharePoint 2010 environment. Sure, we could do that with the BDC, but
it required a very complicated application definition file (ADF) that made it very difficult to successfully create a
connection. Due to this complexity and the fact that Im not a developer at all, I never used the BDC myself without
developer help. Also, we could only read from those data sources. At the 2009 SharePoint Conference in Las Vegas,
Microsoft announced this as #2 on the Top 10 SharePoint 2010 features. Please bear in mind that the BCS is a huge topic
that can go very deep. Todd Baginski (MVP) presented a deep dive on the BCS that goes far beyond what Im talking about,

9/26/2010 3:30 AM

Business Connectivity Services (BCS) Creating an External Content Typ...

3 of 9

http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...

so I will link to that presentation when it becomes available. Also, you can keep track of BCS info on the BCS Team Blog.

da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n

Well, things have changed drastically now. Not only can we build BCS connections in SharePoint Designer with a built-in
GUI, we can also perform write actions back to the data source. This blog will be fairly simple, but that is by design, because
I want to show that a non-developer can easily create a BCS connection and start interacting with external data within
minutes. In this scenario, this is what well be using:
SQL 2008 Database with 1 Table
SharePoint Designer 2010 connected to a SharePoint 2010 Team Site

Build (or locate) your SQL Server database

For this scenario, I built a very simple database with a single table containing 5 columns (Fig 1). Basically, Ive created a
Business Contacts DB for storing the business name, city, state, value, and partner status. After creating the DB, I added 9
rows from within the SQL Server Management Studio (SSMS) interface (Fig 2). For later use, remember that the DB Server
is named MOSS, and the DB is named ECT.

Fig 1 SQL 2008 Database with a simple table

9/26/2010 3:30 AM

4 of 9

http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...

da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n

Business Connectivity Services (BCS) Creating an External Content Typ...

Fig 1 SQL 2008 Database with business contact data

Create External Content Type in SharePoint Designer 2010

After creating the DB and noting the DB/Server name, its time to open up SharePoint Designer (SPD) 2010. SPD 2010 can
only be used with SharePoint 2010. It cannot be used with MOSS 2007, SPD 2007 cant be used with SharePoint 2010, and
SPD 2010 cannot be used for editing other non-SharePoint websites. However, you can have both SPD 2010 64-bit and SPD
2007 (32-bit only) installed on the same machine (I have them both on my Win7 64-bit machine). It is now a dedicated
design tool for SharePoint use. So, to use it, you have to have a SharePoint 2010 site to connect to, otherwise there are no
available functions. Once you connect to your site where the External Content Type (ECT) should reside, click on the Site
Object named External Content Types in the left navigation pane. After that, you should see a button on the top left of the
ribbon labeled New External Content Type. Click that, and you will get to a page where you can create your new content
type (Fig 3).

9/26/2010 3:30 AM

5 of 9

http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...

da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n

Business Connectivity Services (BCS) Creating an External Content Typ...

Fig 3 New External Content Type view in SPD 2010

Name the External Content Type

First, youll want to name the ECT (Fig 4). The display name is what will show up in the External Content Types Site Object
in the SPD 2010 left navigation pane.
Also, I forgot to show it on this screenshot, but the Office Item Type is important. You can leave it as generic, but if you
choose the Contact type, then it will be treated like an Outlook contact, which means that if you later connect to this data
from Outlook, all the data will show up in nifty Contact cards. I did choose that option when making my real ECT but forgot
to show it on this screenshot.

9/26/2010 3:30 AM

6 of 9

http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...

da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n

Business Connectivity Services (BCS) Creating an External Content Typ...

Fig 4 ECT named BizList

Discover Your External Data Source

Now, youll want to click the link next to External System that says, Click here to discover external data sources and define
operations. This will take you to a new page where you click the Add Connection button, which causes a pop-up prompt to
appear for selecting your data source type. The available options are .NET Type, SQL Server, and WCF Service (Fig 5). For
this example, I chose SQL Server.

Fig 5 External Data Source Type Selection

After choosing the SQL Server data source type, you get another prompt. This is where you define the connection to your
database (Fig 6):
Database Server: MOSS (noted above when showing the screenshot of SSMS)
Database Name: ECT (same as above)
Name (optional): What I learned with this field is that if you make the same ECT on another site collection, then you
get a warning when trying to recreate an ECT in a different site collection with the same name. I had left this field
blank the first time I tried it, so when I tried it again in the same farm with a blank name, I got the error. Thats when I
decided to give it a name the name of the site where I was using it. This is important to remember for the future
Identity: I chose to connect with MY user identity the user creating the ECT but I of course have access to the
SQL DB. If I didnt, then I wouldnt be able to make this. The 3rd option is the one that enables the Secure Store
Application ID field at the bottom. This is the new Single Sign-On for those of you who used that in MOSS 2007.

9/26/2010 3:30 AM

7 of 9

http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...

da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n

Business Connectivity Services (BCS) Creating an External Content Typ...

Once you put in the correct information and click Ok, SPD will connect to the DB and return info about it. You will see the
DB icon with the name you gave in the Name field above. You will also see folders that represent tables, views, and other
items. You should see your relevant table within the Tables folder.
Fig 6 Defining the connection to your SQL Server DB

Define Your Operations

This step is where the magic happens. After finding the table you want to use, right-click on it, and you will see some
operations to choose (Fig 7). This part is beautiful, because it does it all for you without any code. In this case, I chose to
Create All Operations. This options creates the well-known CRUD operations Create, Read (Item), Update, and Delete
but it also creates an enumerate operation (Read List), so I like to call it CRUDE.

Fig 7 Creating your CRUD operations


Again, SPD 2010 will do its thing, and when it finishes, you will see a report of the operations that were successfully created
(Fig 8).

9/26/2010 3:30 AM

8 of 9

http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...

da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n

Business Connectivity Services (BCS) Creating an External Content Typ...

Fig 8 A successfully created External Content Type with full CRUD operations

This leads us straight into the next blog, which will discuss what you do with an ECT once its created:
Business Connectivity Services (BCS) - Creating an External List from an ECT

Share this:

StumbleUpon

Possibly related posts: (automatically generated)

Business Connectivity Services (BCS) Creating an External List from an ECT


InfoPath Copy SharePoint List Data to Main Data Source
InfoPath 2010 Designing External List Forms
BCS External Lists

This entry was posted on October 25, 2009 at 11:15 PM and is filed under BCS, SPD 2010, SharePoint 2010. You can follow
any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

Name (required)

E-mail (required)
Website

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del
datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of follow-up comments via email.


Notify me of new posts via email.

9/26/2010 3:30 AM

Business Connectivity Services (BCS) Creating an External Content Typ...

9 of 9

http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...

SharePoint 2010 Update 1 Infrastructure Setup: Single Server Farm


Business Connectivity Services (BCS) Creating an External List from an ECT

da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n

Blog at WordPress.com. | Theme: Andreas09 by Andreas Viklund.

9/26/2010 3:30 AM

You might also like