SharePoint 2010 - Creating External Content Types Using SharePoint Designer

Before we get into this topic, have you read my previous blog on “BCS – Creating Secure Store Target Application”? I suggest you read this before getting into the current topic. Also, please learn about External Content Types by Clicking here

With that, let us see steps to create an External Content Type.

Step 1

Open your SharePoint 2010 site in SharePoint Designer.

SharePoint

Step 2

Select External Content Types in the left pane. You will see the previously created ECTs here only if you have already created them. Else, it will just be empty.

Step 3

Click on “External Content Type” button in the ribbon.

SharePoint

Step 4

Give a “Name”, “Display Name”, and “Namespace” followed by a click on the link next to “External System” to add the external data sources.

SharePoint

Step 5

You will get a screen as shown below. Click on “Add Connection”.

SharePoint

Step 6

You will get a popup as shown below. Select "SQL Server" to add the new connection to the SQL Server database.

SharePoint

NOTE

Use “WCF Service” to connect to a service (web service or WCF service). The only limitation of it is that your service should be returning a set of records, not just a scalar value (based on my experience). Haven’t figured out yet for what the .NET Type is for.

Step 7

Once SQL Server is selected, you will get the below popup. Fill in the database details and select “Connect with Impersonated Custom Identity” and enter “Secure Store Application ID” that is created for this connection.

SharePoint

Step 8

Once the connection is added, choose a table or View which you want to access and add “Read Item” and “Read List” operations.

SharePoint

NOTE

“Read item” is a required operation, “Read List” will not work without “Read Item”. If you want any CRUD operation, you can add those too.

Step 9

As shown below, a 3 step window will appear. Select the columns you want and click “Finish”.

SharePoint

Step 10

Once “Read Item” and “Read List” operations are created or any other operations you want to add are created, go ahead and SAVE the External Content Type.

You’re done. The ECT is created.

If you want to create an External List on an External Content Type, then just right click on the ECT and click “External List”. A popup window will appear. Give a name for “External List” and click OK.

SharePoint

Now, you will have the list on which you can perform all the operations that are defined in the External Content type.