This documentation is archived and is not being maintained.

ConflictOptions Enumeration

Determines how ASP.NET data source controls handle data conflicts when updating or deleting data.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public enum ConflictOptions

Member nameDescription
OverwriteChangesA data source control overwrites all values in a data row with its own values for the row.
CompareAllValuesA data source control uses the oldValues collection of the Update and Delete methods to determine whether the data has been changed by another process.

Concurrency control is a technique that data stores use to control how data is read and changed in the store when multiple clients are accessing and manipulating the same data. For example, one client reads data and presents it to a user, while another client reads the same data, and presents it to a different user. If both users update the data and submit it to the data storage, some unexpected result might occur, because the clients might update different values for the same data. This is considered a conflict.

The ConflictDetection property that is defined for ASP.NET data source controls is used to determine how a control handles data conflicts in the underlying data storage when the underlying data storage is using optimistic concurrency and a delete or update operation is performed.

By default, the ConflictDetection property is set to OverwriteChanges, which means the data source control will overwrite any changes made to a data row between the time the data source control first read data from the row and the time that the row is updated. The primary key is used for locating the data row that will be updated or deleted, but no other comparison of the data is performed. If the data source control is configured to use the CompareAllValues option, however, the control passes the original data in the oldValues collections of the Update and Delete methods so that you can write logic to update or delete data only if these values match the values currently in the data storage. The matching values indicate that the data has not changed since the time it was read.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.