In this article we will be seeing how to create external data column in SharePoint 2010. MOSS 2007 provided the Business Data List Column type, in SharePoint 2010 Business Data List Column is renamed as External Data Column which enables users to add data from the external content types to standard SharePoint lists.
Creating an External Content Type:
Before we integrate external data to the SharePoint, we need to create an external content type. You can use the SharePoint designer to create an external content type. In this example, we will be using SharePoint Designer 2010. Following are the steps involved to create an External Content Type in SharePoint Designer 2010.
Steps Involved:
- Open the SharePoint Designer 2010.
- Click Open Site; enter the Site Name in the Open Site dialog box.
- Select External Content Types in the left Navigation.
- Click to create a new External Content Type as shown below.
- The External Content Type dialog will be displayed.
- Enter the Name and Display Name for the external content type as shown in the above figure.
- Select the Office Item Type as Generic List from the dropdown list.
- Next click the link, Click here to discover external data sources and define operations to integrate the existing customer database.
- The Operation Designer dialog will then be displayed. Click Add a Connection to connect to the database.
- Select "SQL Server" as your Data Source Type.
- Enter the details about your connection to your SQL Server, Database Name customerdetailsdb.
- When the connection is made, your Data Source Explorer will be filled with the database you have specified.
- Now choose the table customers which we are going to connect to the SharePoint.
- Right click the table and select the option, Create All Operations so that you will be able to read, select, update and delete rows from the database table.
- Now the Operation Properties window will pop up which shows the details of the operations that can be performed in the database table.
- Click Next to get to the Parameters page, Select the field that you want to act as an Identifier. In my case I have selected CustomerID as an identifier.
- Click Finish.
- You'll be presented with a list of operations that your External Content Type can do, as shown in the below figure.
- After completing all these steps save the External Content Type.
Creating an External Data Column:
External data column is used for retrieving data from the external data source by creating external content type. When you create External data column in the SharePoint 2010 list you need to specify the external content type.
Steps Involved:
- Select the List in the SharePoint site(Here I am choosing Sample list that I have created in the SharePoint site).
- Go to List Tools => List => Create Column.
- Enter the column name and select the type as External data.
- Choose Customer Name in the "Select the field to be shown on this column".
- In the External Content Type section click on the External Content Type picker.
- Choose the content type that we have created.
- Click ok.
- External Data column is created successfully.
- Click on Add a new item.
- In the External data column that we have created, click the "Select External Items "button.
- See the below one, you will be getting the error.
- How to resolve the above error. Check this link http://www.c-sharpcorner.com/UploadFile/anavijai/4310/.
- Now you will be able to pick the value from the External data picker.
- Click ok.
- A new item is added to the Sample list.
Summary:
Thus the SharePoint External data column is created based on external content type that we have created using SharePoint Designer 2010 to get the values from the external data source.