SharePoint 2010 Cookbook: How to Create External Lists & Include Databases Using SharePoint Designer 2010

SharePoint 2010 adds many new features to Lists. In this article, we will take a look at how to create an External List. As you know, the External List is used for displaying content that comes from Business Connectivity Services (BCS). The Business Data Connectivity (BDC) Service enables SharePoint to display business data from back-end server applications, Web services, and databases. This walkthrough shows you how to create a model for the BDC service that returns information about contacts in a sample database.

Challenge:

We did not have External Lists in either SharePoint 2003 or SharePoint 2007, and this was a limitation since we couldn't directly access SQL Server databases to get data into SharePoint.  Now with SharePoint 2010, it is possible to create a list from other external sources with the help of external content types and External Lists.  You can connect with any external source and can create a list from that. In this example, I am going to show you how to create a list from the SQL server database.  The advantage of this is you can not only view, but also insert, update, and delete using external content types.  You can create External Lists using SharePoint Designer 2010. In the first part of this post, I will demonstrate how to create an External List, and in the second part, we will look at how to create an External List including a Database with the help of SharePoint Designer.

Solution:

SharePoint 2010 has a new type of List called the External List which is used for displaying data that comes from Business Connectivity Services (BCS).

First, I will demonstrate how to create an External List that uses data from a SQL table through SharePoint Designer 2010.

  • Step 1: Make sure that you created a Northwind database in SQL Server.

 

  • Step 2: We go to SharePoint Designer to connect the database with SQL Server as follows:
    • Click on the External Content Types menu on the left pane
    • Then, select the External Content Types icon on the top.
    • You will see a Connection window appear:

 

  • Step 3: Click on Add Connection button

 

  • You will see a dialog appear to select Data Source Type as pictured below
  • Of course, we will select SQL Server

 

  • After selecting Data Source Type, we fill in the SQL information fully, including Database Server, Database Name, and Secure store Application ID as shown below:

 

  • Don't forget to enter User Name and Password when BSC Secure Store is shown:

 

  • Step 4: After connecting successfully, you will see Northwind database shown on Data Source Explorer as shown below.
  • We will select a Table to create in here by right-clicking Table Name and selecting Create All Operations:

 

  • A Parameter Configuration is shown after that; you can select any columns which you need and click the Finish button to complete:

 

  • Finally, don't forget to click the Save button after you're done. This is pretty important, for obvious reasons:

 

  • Now, we have a Northwind database as we expected:

 

Now, I will show you how to create an External List including a database, from SharePoint Designer. It's very easy.

  • Step 1: First, we go to SharePoint Designer 2010 to select a site for configuring
  • For example: I select the http://singlemoss2010 link

 

  • Make sure that we have configured BDC before. Don't forget that we are getting data from BDC so we must have a database in here.
  • For example: I created the Northwind database in here.

  • Next, click on the External List menu on the Ribbon to create a new list. You will see a Create External List form appear. You only need to fill in the List Name in the Name textbox as pictured below:

 

  • Step 2: Now, go to the site which you selected for configuring earlier. We will see a new External List created from SharePoint Designer.
  • But you may be surprised when clicking on the new list since you will not see its database in here. Don't worry about this! This only means that you have not yet assigned access privileges for the current logged-in user yet.
  • Step 4: To assign access privileges for a user, go to the Central Admin Page –> Application Management and select Manage service applications:

 

  • Click on the Business Data Connection Services hyperlink as shown below:

 

  • After clicking on BDC Services, you will see the database which you created earlier. Please click on the Database Name to expand the context menu and select Set Permissions:

 

  • You should add users and assign access permissions for them in here:

 

  • Step 5: After finishing the configurations above, you only need to go to the site and press F5 to refresh the page.
    • Now, everything is OK. You will have an External List including database in here:

Notes:

  • CAUTION: SharePoint 2010 External List throws a webpart exception when working with an external content type that was created in Visual Studio 2010.

I have created an external content type in Visual Studio which connects to a SQL 2008 database. Following is what I've covered:

  1. Created External Content types in Visual Studio 2010
  2. Wrote implementation for ReadItem, ReadList, Create and Update
  3. Deployed the content type through Visual Studio (Right click Solution name -> Deploy)
  4. Verified through SharePoint Designer 2010 that the content type has been added
  5. Added permissions for this ECT through Central Administration
  6. Created an External List using SharePoint 2010 (also created directly from browser – Web Application)

2. Mapping External List Columns to Database Columns

  • Every column in the file you want to import must be mapped to an existing column in the prospects table in the Siebel Database, or to an attribute created for this purpose. If you import response or campaign data, you can also map to response and campaign fields. For information about mapping attributes, see Adding Additional Attributes to a List.
  • CAUTION: Make sure that you map every column before launching the import.
  • To map list columns to database columns in the prospect table:
  1. Navigate to the List Management screen > Lists view.
  2. Drill down on the list name.
  3. Click the List Import view tab.
  4. Scroll down to the List Import Format list and map every column to an existing database column in the prospect table or to an attribute created for this purpose.
  5. In the List Import Format list, save the format in one of the following ways:
  6. The first time you save a format, click Save as New.
  7. Save as New allows you to retain the original format and save the modified format separately. All saved formats appear in the List Management screen's List Imports Formats view tab.
  8. Click Save to overwrite the original format.
  9. Use this save option if you make changes to the mappings and want to preserve them.
  10. After you save the List Import Format, perform the following steps to verify the columns that will be used for matching and update.
  11. In the form in the List Import view, copy the name of the List Import Format in the List Import Format field.
  12. In the List Management link bar, click List Import Formats.
  13. Query for the name that you copied in the List Import view.
  14. In the lower list, you will see the columns that you mapped from the import file.
  15. In the Exact Match Column field, check each column from the list that you want to use for the exact match.
  16. NOTE: These settings are only used when you have selected Exact match or Exact and intelligent match as the matching approach.
  17. In the Allow Field Updates field, check any fields that you want to allow to be overwritten when using the Overwrite existing record match resolution.

 

See Also:

SharePoint

Applications

SharePoint apps are stand-alone applications that perform specific tasks on a SharePoint site. Apps can perform functions such as managing a discussion board or knowledge base, performing project management or time tracking tasks, or doing other workflow operations.

SharePoint

Product Suites

Experience greater power and savings by bundling our SharePoint apps and web parts.


Essentials


Essentials Plus


Bamboo Premier


Project Management Suite


Knowledge Management Suite


External User Manager


SharePoint

Web Parts

Extend SharePoint beyond its out-of-the-box capabilities by tailoring it to your requirements with Bamboo Solution’s growing portfolio of Web Parts. Web Parts are the building blocks of pages on a SharePoint site that can be used to customize the user interface and content of a site page. 

SharePoint

Product Suites

Experience greater power and savings by bundling our SharePoint apps and web parts.


Essentials


Essentials Plus


Bamboo Premier


Project Management Suite


Knowledge Management Suite


External User Manager


Office 365

Cloud Parts

Cloud Parts are functional components that extend your SharePoint environment whether it’s hosted, on-premises, or part of Microsoft Office 365. More than mere ports of existing software to the cloud, our Cloud Parts have been built from the ground up to take advantage of the best that the cloud has to offer.

SharePoint

Product Suites

Experience greater power and savings by bundling our SharePoint apps and web parts.


Cloud Parts Suite for O365/SP Onl.


Featured Services

SharePoint Health Check

A SharePoint Health Check will identify the causes of issues and risks associated with your specific environment, and is custom tailored to provide you with the best recommendations to optimize your SharePoint environment.

SQL Health Check

Document recommendations relating to performance, stability, availability, or a specific focus you request of your SQL Server database instances.

My SharePointXperts

The truth is that each SharePoint skill may not be a full time job for many organizations, and it is nearly impossible for one person to do everything you need – so augment your team with SharePointXperts; providing the skill sets you need when you need them!