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 Preface need accomplish First R...
1. Simple configuration of nginx's dynamic an...
The :not pseudo-class selector can filter element...
This article example shares the specific code of ...
What is MySQL multi-instance Simply put, MySQL mu...
Table of contents 1. Basic grammar 2. Filter by c...
This article introduces the sample code of CSS to...
This is an interview question, which requires the...
Introduction to Nginx Nginx ("engine x"...
Preface MySQL continued to maintain its strong gr...
cause The reason for writing this blog is that I ...
ffmpeg is a very powerful audio and video process...
Preface Recently, I accidentally discovered MySQL...
Given an array [1,8,5,4,3,9,2], write an algorith...
1. HTML Image <img> 1. The <img> tag ...