When you get following error while inserting or updating the database using ADO.NET Entity model, ensure that your database table has Primary key.
Unable to update the EntitySet 'UserDetail' because it has a DefiningQuery and no element exists in the element to support the current operation
If primary key will not be there in the database table, you will get above error.
Thanks