WCF Request Error: Entities Participate in the Relationship

When accessing database from WCF through Entity Framework, I got this error message:

This error is due to the primary key of the table is not specified as identity. In SQL Server, this is mandatory for primary key column.

To specify a primary as identity, right click on the table > Design > Click on primary key column. On the bottom, there is Column Properties. Scroll down to Identity Specification and expand it. The (Is Identity) should be set to Yes.

On different case, I also got “An error occurred while updating entries.”-request error. This is caused by the same problem: not specify the primary key as identity in SQL Server database.

Do remember that you do not need to refresh Entity Framework after specify the primary key as identity.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s