LINQ to SQL – ‘Row not found or changed‘

Posted by | September 23, 2010 | ASP.NET, Web Development | 12 Comments

This System.Data.Linq.Changeconflictexception with the message ‘Row not found or changed‘ appears to be a very annoying bug or error, but this is not the first time that i am getting this error while updating database record with Linq to SQL on ASP.NET. I tried to re-drag SQL tables from server explorer to the designer and rebuild the solution. I am still getting the ‘Row not found or changed’; there is a lack of details.

Reading on other blogs, found this from readme:
Tables with columns of type DateTime with higher precision than seconds do not update correctly. Blinq creates BoundField objects for DateTime fields that do not contain precision beyond seconds, so updates with DateTime fields with high precision that participate in optimistic concurrency fail. To fix this, do one of the following:

Change the precision displayed by the BoundField object by setting DataFormatString=”{0:o}”, HtmlEncode=false, and ApplyFormatInEditMode=true.

Designate the DateTime field as never participating in optimistic concurrency. See “Changing a Field’s Update Mode” earlier in this document to change the update mode for this column. Use this option carefully—removing this column from participating in optimistic concurrency will allow overwrites of the value to succeed even if the database’s value has been changed.

MSDN document for ChangeConflictException:

About Farid

Creative web developer/designer, big fan of HTML5, CSS3 and client-side development. Software developer at Allegra Strategies London.

  • Nino

    Goed bezig saghbi.

  • jim

    Thats exactly what i was looking for. simple solution.

  • Farid Hayati

    thanks sagbhi Ik moet exceptions ergens kwijt kunnen:P. Zo kan ik het terug vinden met de oplossing.

  • Azita

    Sounds very intresting, but the problem is that I dont understand the logic of computer siences :) I think the best way of understaning this complicated subject is to get engaged to a system administrater, like I did :)

  • Nino

    Saghbi gewoon deze:

    try {
    // Anything goes….
    } catch (Exception e) {
    // Ignore… :P

    Ja dit is inderdaad een goede manier om dingen bij te houden saghbi, kunt altijd snel nalezen.

  • Nino

    Farid you should get Azita also into programming, let her also do ASP.NET hehe ;)

  • Farid Hayati

    Haha Nino straks komt ze met hexadecimal, dan moet ik het gaan uitleggen als programmeur:P.

  • ipa health insurance

    Katrina rocks!?!

  • fl insurance license

    I’m glad that you wrote that…

  • massotherapy insurance

    Leah, whatever man :D


  • vlc media player free downloaD


  • autism symptoms

    It’s really a nice and helpful piece of information. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thanks for sharing.