Row not found changed. Unable to find the row or the row has been changed

Source: Internet
Author: User
Row not found or changed. The row cannot be found or the row has been changed
Solution.

If it is not important data. You do not need to pay attention to concurrency.

A simple solution is
Open the dbml (LINQ) file and change "Update Check" in the object class to never.
Do not change the primary key (ID.

The second method does not require updating the records. Please use SQL statements directly without retrieving the entire data and then updating it. This may cause a conflict.

DC. executecommand ("Update [DBO]. [mytable] Set num = num + 1 where id = @ P0", M. ID );

 

Method 3.

Try
{
DC. submitchanges (system. Data. LINQ. conflictmode. continueonconflict );
}
Catch (system. Data. LINQ. changeconflictexception ex)
{

DC. changeconflicts. resolveall (refreshmode. keepcurrentvalues); // keep the current value

DC. changeconflicts. resolveall (refreshmode. overwritecurrentvalues); // keep the original update and discard the current value.
DC. changeconflicts. resolveall (refreshmode. keepchanges); // Save the current version if the original value is in conflict.

// Note: submitchanges () is required after the conflict is resolved. Otherwise, it is not updated to the database.

DB. submitchanges ();
}

Solution:
Open dbml (LINQ) file, and find your entity change the propery (field) "Update Check" to never

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.