User Id :    Password :      New Member   Forgot Password  
 
Unable to update the EntitySet-because it has a DefiningQuery and no element exists to support the current operation
Description Today I was struggling to solve this strange error in entity framework while saving a new record in a table. "Unable to update the EntitySet - because it has a DefiningQuery and no UpdateFunction element exist to support the current operation."   No. of Views     3022
  Rating     0
Author Najmul Hoda   Posted On     13 Feb 2014
Tags ADO.NET,.NET Frameworks,Entity Framework,Entity Framework 5    

Sample Code   Download Code

 

Today I was struggling to solve this strange error in entity framework 5 while saving a new record in a table.

 

The error was : "Unable to update the EntitySet - because it has a DefiningQuery and no <UpdateFunction> element exist to support the current operation."

 

I googled alot and found this was happening because I did not add a primary key in my table in which I was trying to insert/update recods.

 

I added primary key in my table and then it worked liked nothing happned earlier... :)

 

[Note] : to add a primary key on existing table you may reffer to : http://www.dotnetlogix.com/KB/Article/57/How-to-create-primary-key-on-a-table

 

Hope this will help someone....

 

 

 


 

About Author

About Author He is a team lead, having 8+ years of experience. He loves writing technical article for .Net developers. Najmul Hoda
No Photo
 
Country United States
Company BirlaSoft
Home Page http://www.magixchat.com

Rate this article

Rating options from poor, fair, good, very good to excelent.  
 

Comments

   
Write your comment here.
Comment
Verification Code