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
The use of computed in vue3. Since vue3 is compat...
Table of contents 1. Use JavaScript to parse the ...
Preface How to write efficient SQL statements is ...
Because I have always used vscode to develop fron...
Preface The <router-link> tag is a great to...
I recently started learning about database knowle...
Using cutecom for serial communication in Ubuntu ...
Introduction: The configuration of Docker running...
Do you know what fonts are used in the logo desig...
Table of contents Standards for smooth animation ...
Simple application deployment 1. Directory struct...
In the /etc/my.conf file, add the following line ...
Table of contents Preface: 1. Reasons for the eve...
The Linux stream editor is a useful way to run sc...
1. Query process show processlist 2. Query the co...