SharePoint 2010 BDC using EF4: Troubleshooting

This article listing common errors when develop CRUD Business Connectivity Services solution in SharePoint 2010 using ADO.NET Entity Data Model (EF4).

Error 1: ConnectionStrings

“The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.’”.
“ADO.Net Entity Framework Connection String: “Keyword not supported: ‘Data Source'”
Entity (External Content Type) cannot be found with Namespace=***”

Solution 1: Copy ConnectionStrings

Copy the connection strings generated from ADO.NET Entity Data Model (app.config) to SharePoint Web Application Configuration file (web.config)

Error 2: Entity Framework

[ConstraintException: This property cannot be set to a null value.]
   System.Data.Objects.DataClasses.StructuralObject.SetValidValue(String value, Boolean isNullable)

Solution 2:

Modify the SetValidValue method in the generated designer code from SetValidValue(value, false) to SetValidValue(value, true)

Error 3: Update field

The Field named *** contains an Identifier which is not read only. The Update operation requires a corresponding PreUpdaterField for this Field on Method with Name ‘Update’ on Entity

Solution 3:

Set the  Pre-Updater Field property of the Identifier TypeDescriptor in the method to True

Leave a Reply