Business Connectivity Services Tools Support
Last modified: April 15, 2010
Applies to: SharePoint Server 2010
External Content Types are the basic building blocks for creating solutions by using Microsoft Business Connectivity Services (BCS). Microsoft SharePoint Designer 2010 and Microsoft Visual Studio 2010 each offer External Content Type designer, however each designer targets different scenarios, types of data sources, and types of audiences.
SharePoint Designer 2010 provides a "no code" experience for composing simple to intermediately complex solutions based on External Content Types, which you can author through a wizard-driven user interface (UI). Composing refers to the assembly of a solution from existing reusable components, instead of building the solution from scratch. After you create an External Content Type, you can create and customize external lists, Web Parts pages, workflows, and forms that are based on it.
Authoring External Content Types
When you open a site in SharePoint Designer 2010, you see a new gallery and designers for authoring External Content Types. The gallery enables you to access the list of External Content Types published into the shared Business Connectivity Services Metadata Store (formerly known as the Business Data Catalog). The designers support connectivity to Microsoft SQL Server databases, Windows Communication Foundation (WCF) services (including Web services), and Microsoft .NET Framework assemblies (previously created by a code developer). The modeling approach is to discover and map the data schema and operations exposed by the external data source to the desired schema and stereotyped operations (Read Item, Read List, Create, Update, and Delete) of your External Content Type. Because of this, the interface that is exposed by the external data sources must be usable by Business Connectivity Services or Business Connectivity Services-friendly for SharePoint Designer 2010 to be able to consume it. Direct access to individual database tables is always considered Business Connectivity Services-friendly. For more information about creating stored procedures, WCF services, Web services, and .NET Framework assemblies that are compatible with Business Connectivity Services, see Creating .NET Connectivity Assemblies and Web Services.
SharePoint Designer 2010 also enables you to define associations between External content Types based on foreign keys, by configuring stereotyped association navigation operations that enable retrieval of associated External content Type instances.
In addition to data schema, stereotyped operations, and associations, SharePoint Designer enables you to configure the Office integration behaviors of your External Content Types. For example, you can configure data filters, search support, and data offlining into Microsoft Outlook and Microsoft SharePoint Workspace. You can also map External Content Types to native item types like Contact, Task, Appointment, and Post.
SharePoint Designer 2010 supports the most common external data connectivity scenarios; however, there are advanced connectivity behaviors that are not supported such as bulk and batch operation stereotypes, generic or polymorphic services, and associations not based on foreign keys.
Authoring External Lists
After you define an External Content Type, SharePoint Designer 2010 enables you to create external lists based on it. You can do this by using an auto-generate option available in the External Content Type's summary page or by choosing the new External List option in the Lists gallery.
Generating and Authoring InfoPath Forms
SharePoint Designer 2010 enables you to have any external list use Microsoft InfoPath forms instead of the standard SharePoint forms. You can choose to autogenerate InfoPath forms when you create a new external list or you can generate forms for existing lists. The autogenerated forms are fully functional and ready to use, except for the cases where fields on your External Content Type are considered "complex." A complex field is one whose data type involves a structure that goes beyond a simple value, for example, an address structure that includes street, city, state, and country/region. In this case a form is generated, but manual customization of the form might be required to make it functional. You can always customize existing external list InfoPath forms using the full power of InfoPath Designer 2010, which has been extended to provide an integrated form customization experience when launched in the context of an external list.
External Data in Workflows
In the workflow space, SharePoint Designer 2010 enables you to access external data by authoring workflows that interact with external lists. The read and write workflow activities for regular SharePoint lists have been extended to support external lists. This means that the authoring experience is as simple and flexible as it is for regular lists, with the additional benefit that you can use external lists to access an external data source.
External lists do not support triggering workflows. However, in SharePoint Designer 2010 you can create a site-level, list-level, or reusable workflow that accesses one or more external lists.
Web Parts Pages and Profile Pages
SharePoint Designer 2010 offers general support for authoring Web Parts pages that enables you to create custom pages based on the external list or the BDC Web Parts. Specific to Business Connectivity Services, SharePoint Designer 2010 enables you to autogenerate Profile pages for an existing External Content Type. A Profile page is a special type of Web Parts page that shows a 360-degree view of an External Content Type instance by showing its details and its associated External Content Types. Profile pages are the default target of external data search result links.
To summarize, if you need to integrate external data into SharePoint and Office without writing code, we recommend using SharePoint Designer 2010.
In Visual Studio 2010, you can either create reusable Business Connectivity Services code components that can be used by others to compose new solutions, or you can create complete client-server solutions that use Business Connectivity Services. In the case of reusable components, External Content Types are probably the most important, but you can also create custom class library projects that implement specific interfaces defined by Business Connectivity Services to provide external data access logic and UI.
Complete solutions can involve any combination of server-side and client-side components that are typically packaged as a SharePoint solution package (.wsp) or ClickOnce solution package. These types of solutions generally use the full power of Visual Studio to create a range of SharePoint and Office components, from sites, lists, and Web Parts to custom Office add-ins. You can extend any of these by using code to access external data through Business Connectivity Services.
Authoring External Content Types
From a Business Connectivity Services perspective, the most prominent addition in Visual Studio 2010 is the new Business Data Connectivity Model project template that comes with a set of visual designers and code management capabilities to enable you to author External Content Types that can access virtually any data source through your own custom connectivity logic in .NET Framework code. A notable aspect of the tool is that it encapsulates the SharePoint specifics so you that you do not need to be a SharePoint expert to create very powerful External Content Types that can perform actions such as aggregating data from multiple sources, applying transformations and business logic, and handling custom security schemes.
Business Data Connectivity Model projects in Visual Studio 2010 always produce External Content Types of type .Net Connectivity Assembly. External Content Types that connect directly to databases, WCF, or Web services can be authored and included in SharePoint solution projects, but only XML-based authoring (without a visual design experience) is supported for them.
Authoring Reusable BCS Components
In Visual Studio 2010, you can author Business Connectivity Services-enabled reusable components for both client and server by creating standard class library projects that implement specific Business Connectivity Services-defined interfaces. You can also make use of the Business Connectivity Services object models to access external data. Some examples of reusable components are:
Code actions that can be invoked through the ribbon within Outlook.
External Data Parts that can be hosted in declarative task panes in Outlook to present external data.
Workflow activities that access external data by using the Business Connectivity Services object model. These can then be made available for use within the Workflow Designer in SharePoint Designer 2010.
Field renderers can be created to provide custom UI for complex data types inside external lists.
Custom credential providers that can be used to access systems that support custom authentication mechanisms.
Authoring BCS-Enabled Office Add-ins
Visual Studio 2010 enables you to integrate external data into Office applications by creating a standard Office add-in project that uses the Business Connectivity Services object model.
External Data in Workflows
Visual Studio 2010 enables you to access external data by authoring code-based SharePoint workflows that interact with external lists or the Business Connectivity Services object models.
When authoring SharePoint solutions, you can use a combination of Visual Studio 2010 and SharePoint Designer 2010. However, you must be aware that they have slightly different authoring and deployment models that affect interoperability. SharePoint Designer works with a "live" connection, so changes are saved directly to the SharePoint server. In the case of Visual Studio 2010, you must build projects first and then deploy them to the SharePoint server. In Visual Studio 2010, solution packages can be deployed manually, or deployed automatically when the user run or debugs the project.
Projects created in Visual Studio 2010 can be edited further in SharePoint Designer after they are deployed to the SharePoint server. However, components authored in SharePoint Designer must be manually exported or imported into Visual Studio. In the case of Business Data Connectivity (BDC) service models, SharePoint Designer enables you to export one or more External Content Types into an XML file that you can then import into Visual Studio.
Visual Studio does not support a visual experience for External Content Types that are not based on a .NET Framework assembly, so for these an XML-only authoring experience is provided.