ConflictOptions Enum

Definition

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

public enum ConflictOptions
Inheritance
ConflictOptions

Fields

Name Value Description
OverwriteChanges 0

A data source control overwrites all values in a data row with its own values for the row.

CompareAllValues 1

A data source control uses the oldValues collection of the Update and Delete methods to determine whether the data has been changed by another process.

Remarks

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.

Applies to

Prodotto Versioni
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also