DataContext.ChangeConflicts Property
.NET Framework (current version)
Gets a collection of objects that caused concurrency conflicts when SubmitChanges was called.
Assembly: System.Data.Linq (in System.Data.Linq.dll)
Property Value
Type: System.Data.Linq.ChangeConflictCollectionA collection of objects that caused concurrency conflicts.
The following example shows how the collection can be iterated over to retrieve conflict information.
Dim db As New Northwnd("...") Try db.SubmitChanges(ConflictMode.ContinueOnConflict) Catch ex As ChangeConflictException Console.WriteLine("Optimistic concurrency error.") Console.WriteLine(ex.Message) For Each occ As ObjectChangeConflict In db.ChangeConflicts Dim metatable As MetaTable = db.Mapping.GetTable(occ.Object.GetType()) Dim entityInConflict = occ.Object Console.WriteLine("Table name: " & metatable.TableName) Console.Write("Customer ID: ") Console.WriteLine(entityInConflict.CustomerID) Console.ReadLine() Next End Try
.NET Framework
Available since 3.5
Windows Phone Silverlight
Available since 7.1
Available since 3.5
Windows Phone Silverlight
Available since 7.1
Show: