When I used entity frame, I found this problem:
"Unable to update entityset" ***** "because it has a definingquery, and Element does not support the current operation Solution to the Problem
Testdatasourcedataentities context = new testdatasourcedataentities ();
T_user model = new t_user ();
Model. userid = "gxw1111 ";
Model. Username = "aaaaaaaa ";
Model. userpwds = "123456 ";
Context. addtot_user (model );
Context. savechanges (); // error message
Puzzling, finally found
1: The table in the object must have a primary key (this indicates that the t_user table must have a primary key). If not, this prompt is displayed.
2: After the primary key is set, a similar problem still occurs during running, which is depressing.
1): Method 1: First Delete the model with the Set primary key from EF, and then add it to EF again, that's OK.
2) If none of the methods are successful, use this more practical method: Create a project and re-associate ef. At this time, this problem is solved or deleted *. the edmx file and the database re-Association have all been tested and passed completely.