May 18, 2011

Unable to update the EntitySet '' because it has a DefiningQuery and no element exists in the element to support the current operation

Unable to update the EntitySet '' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation

Got the above error when I was writing Code to insert data using EntityDataModel with below code


                Student_Marks sMarks = new Student_Marks();
                sMarks.Student_Id = int.Parse(model.Student_Id);
                sMarks.Marks = int.Parse(model.Marks);
                DBobj.AddToStudent_Marks(sMarks);
                DBobj.SaveChanges();




Solution : I rechecked Table Student_marks in Database and Primary Key was not
set in the table , I set the primary key and above problem was resolved

1 comment:

  1. well done my genius boy....

    it saved me!

    cheers!

    ReplyDelete