ObjectDataSource.ConflictDetection Property

Gets or sets a value that determines whether or not just the new values are passed to the Update method or both the old and new values are passed to the Update method.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public ConflictOptions ConflictDetection { get; set; }
/** @property */
public ConflictOptions get_ConflictDetection ()

/** @property */
public void set_ConflictDetection (ConflictOptions value)

public function get ConflictDetection () : ConflictOptions

public function set ConflictDetection (value : ConflictOptions)

Not applicable.

Property Value

One of the ConflictOptions values. The default is ConflictOptions.OverwriteChanges.

The DataObjectTypeName property determines whether parameters for old and new values are applied to the method specified by the UpdateMethod property. For example, if the method that is specified by the SelectMethod property returns a DataTable control with the columns Name and Number, and the ConflictDetection property is set to the OverwriteChanges field, parameters are created for Name and Number for the Update method. If the ConflictDetection property is set to the CompareAllValues value, parameters are created for Name, Number, original_Name, and original_Number. (The exact name of the parameters for the original values depends on the OldValuesParameterFormatString property.) The ObjectDataSource then determines whether the method that is specified in the UpdateMethod property has parameters that match.


If you are not familiar with the Data Access features in ASP.NET 2.0, you should read some of these topics before continuing:

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, an unexpected result might occur, because both clients might provide different values for the same data. This is considered a conflict. By setting the ConflictDetection property to the CompareAllValues value, the Update method can then compare the old and new values to the original data source to detect conflicts and handle them as necessary.

The ConflictDetection property delegates to the ConflictDetection property of the ObjectDataSourceView object that is associated with the ObjectDataSource control.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions