Professional Documents
Culture Documents
Business Connectivity Servi
Business Connectivity Servi
Business Connectivity Servi
http://claytoncobb.wordpress.com/2009/10/25/business-connectivity-serv...
1 of 9
da
ra
m_
ra
me
sh
@
ya
ho
o.c
o.i
n
My Categories
Top Posts
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
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
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
forms
sharepoint
SharePoint 2010
UserProfileService user roles W2K8R2 Win7 Windows7 Windows 7 Windows Server 2008 R2 Word 2010 Workflow
9/26/2010 3:30 AM
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
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.
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
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
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
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.
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
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
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.
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
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
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>
9/26/2010 3:30 AM
9 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
9/26/2010 3:30 AM