0

When I run

DB.SubmitChanges();

I occasionally get an error that reads: "Row not found or changed". The reason why this error bugs me so much is because there will always a row that should be found for this query, and changes are only made if there are new changes to make.

I can't seem to figure out why this error pops up Are there some common reasons why this error shows up that I can try to find in my code?

sooprise
  • 22,657
  • 67
  • 188
  • 276

1 Answers1

1

There could be 2 reasons:

  • the Row was deleted
  • the row was changed by another client

Both are due to concurrency, the first thing to check is if this could indeed be a multi-user issue.

H H
  • 263,252
  • 30
  • 330
  • 514
  • Is it good practice to define many changes and have one DB.SubmitChanges(); or define many changes and have one DB.SubmitChanges(); after each change defined? – sooprise Jun 21 '10 at 18:56
  • It depends (on your business requirements). Batching the changes will be more efficient but also increases the likelihood another process made changes. But you will have to deal with that anyhow. – H H Jun 21 '10 at 19:00