Working with External Content Type in Sharepoint 2010


In this article I am showing you how to create an external content type for sharepoint 2010.

Here I am showing three things

  • Creating External Content type.

  • Creating External Data column for list.

  • Creating External List

Before starting ,you should have an SQL server Table.I have a database with the name BCS and a table named BCS_customer with two columns NameID and Name

I. Creating External Content type

  1. For the first step you have to create an external content type using Sharepoint designer 2010
  2.  
  3. Open your site in SPD 2010

    image1.gif
     
  4. Click on External Content Type.
     
  5. Click on New External Content Type

    image2.gif
  6. You will get a screen as shown below Click on Add Connection

    image3.gif
     
  7. I have selected SQL Server as the option. You have other options also here

    image4.gif

  8. Next you have to give Data connection with my Database server name and database name. You can also configure out which identity is used here to talk to the database. Please make sure that you may need to grant permissions on the SQL Server itself for the appropriate user.
     
  9. After That it will add the tables in the connection as shown below.
     
  10. Click on the table and select All operations

    image5.gif
     
  11. From the next screen you have to select the columns you want to display

    image6.gif
     
  12. If sucessfully added you will get a screen like below
     
  13. Click on Create Profile Page

    image7.gif
     
  14. You are done with External Content Type creation

    image8.gif

II. Creating External Data column for list

  1. Go to Sharepoint list and create a column of type External Data.
     
  2. As shown below select the External Content Type we just created

    image9.gif
     
  3. Click OK
  4. Select the options as shown below

    image10.gif
     
  5. In the below Screen you can see the data populated from the BCS_Customer Table

    image11.gif

III. Creating External List

  1. You have to go back to your Designer and click on the Create list and Form
  2. Give proper name for your list clik OK

    image12.gif
     
  3. Once done you will get a an external list connected to our SQL table you can add/update/delete data resides in SQL Table

    image13.gif