I’m getting the following error when trying to delete objects in my database while using Entity Framework 4.
“Unable to update the EntitySet ‘SampleDetails’ because it has a
DefiningQuery and no element exists in the
element to support the current
operation.”
It seems to be a common problem with lots of solutions on Google but nothing seems to work for me. The affected table has a composite primary key made up of three fields.
I have tried deleting the <DefiningQuery> elements but then I can’t read the data from the database in the first place.
You need to add primary key as a separate column like i.e.
SampleDetailsIDto SampleDetails.