Error message: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=472540 for information on understanding and handling optimistic concurrency exceptions. References: https://stackoverflow.com/questions/1836173/entity-framework-store-update-insert-or-delete-statement-affected-an-unexpec Reason: The primary key ID is not set to auto-increment , resulting in insertion failure. Solution: Set the table's primary key ID to auto-increment. MySQL setting method: right click on the table --> design table --> select primary key id --> check it. SQL Server setting method: right click on the table --> design table --> select the primary key id --> double-click the value of "(is identifier)", change it to yes, and set the identifier increment and identifier seed to 1. The above solution to the EF (Entity Framework) insert or update data error is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Deeply understand how nginx achieves high performance and scalability
>>: Understanding and using callback functions in JavaScript
Table of contents Background Description Creating...
vue-element-admin import component encapsulation ...
1. Experimental description In the virtual machin...
The installation of Harbor is pretty simple, but ...
This article mainly introduces the sample code of...
Table of contents 1 A brief introduction to syste...
Mixin method: The browser cannot compile: The old...
bmi Voyager Pitchfork Ulster Grocer Chow True/Sla...
Four practical vue custom instructions 1. v-drag ...
Table of contents CSS3 Box Model a. CSS3 filter b...
This article example shares the specific code of ...
Sometimes the page is very long and needs an arro...
Recent product testing found a problem that when ...
Table of contents npm download step (1) Import (2...
Table of contents 1. Auxiliary functions 2. Examp...