ChangeConflictException Class

Represents the exception that is thrown when an update fails because database values have been updated since the client last read them.

System.Object
  System.Exception
    Microsoft.SharePoint.Linq.ChangeConflictException

Namespace:  Microsoft.SharePoint.Linq
Assembly:  Microsoft.SharePoint.Linq (in Microsoft.SharePoint.Linq.dll)

[SerializableAttribute]
public class ChangeConflictException : Exception

This exception is thrown by SubmitChanges() when it detects a concurrency conflict. Your code should always catch and resolve the discrepancies. For more information about resolution of conflicts, see How to: Write to Lists Using LINQ to SharePoint.

The following is a simple example of catching the exception and resolving the discrepancies.


foreach (TeamMember teamMember in teamSite.TeamMembers)
{
    teamMember.TopTask = "Fiscal Planning";
}

try 
{
    teamSite.SubmitChanges();
}
catch (ChangeConflictException e) 
{
    teamSite.ChangeConflicts.ResolveAll();
    teamSite.SubmitChanges();
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: