ConflictOptions Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines how ASP.NET data source controls handle data conflicts when updating or deleting data.
public enum class ConflictOptions
public enum ConflictOptions
type ConflictOptions =
Public Enum ConflictOptions
- Inheritance
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 |
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
See also
.NET