Name
DBConcurrencyException
Synopsis
The exception is thrown by a DataAdapter if an
attempt to update, delete, or insert a row results in zero affected
rows. For example, if a data adapter attempts to execute a SQL DELETE
statement to remove the record corresponding to a deleted
DataRow from the data source, and no rows are
deleted, this exception will be thrown. This exception usually
indicates that another user has already modified the row you are
attempting to update and a matching row can’t be
found. You can suppress the DBConcurrencyException
by setting the
System.Data.Common.DataAdapter.ContinueUpdateOnError
property to true, in which case invalid rows are
skipped, and the error information is placed in the
DataRow.RowError property of rows having errors.
Alternatively, you can respond to concurrency errors during the
update (and suppress them if needed) by handling the data
adapter’s RowUpdating event.
public sealed class DBConcurrencyException : SystemException { // Public Constructors public DBConcurrencyException( ); public DBConcurrencyException(stringmessage); public DBConcurrencyException(stringmessage, Exceptioninner); // Public Instance Properties public DataRow Row{set; get; } // Public Instance Methods public override void GetObjectData(System.Runtime.Serialization.SerializationInfosi, System.Runtime.Serialization.StreamingContextcontext); // overrides Exception }
Hierarchy
System.Object
→
System.Exception(System.Runtime.Serialization.ISerializable)
→
System.SystemException ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access