This documentation is archived and is not being maintained.

ObjectDataSourceView::Delete Method (IDictionary, IDictionary)

Performs a delete operation by calling the business object method that is identified by the DeleteMethod property using the specified keys and oldValues collections.

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

public:
int Delete(
	IDictionary^ keys, 
	IDictionary^ oldValues
)

Parameters

keys
Type: System.Collections::IDictionary

A IDictionary of the key values used to identify the item to delete. These parameters are used with the DeleteMethod property to perform the delete operation. If there are no parameters associated with the method, pass nullptr.

oldValues
Type: System.Collections::IDictionary

A IDictionary that contains the additional non-key values used to match the item in the data source. Row values are passed to the method only if the ConflictDetection property is set to the CompareAllValues field.

Return Value

Type: System::Int32
The number of rows deleted; otherwise, -1, if the number is not known.

The default value is -1, which means that an unknown number of rows were deleted. To return a different value, set the AffectedRows property of the ObjectDataSourceStatusEventArgs object of the Deleted event handler. The number of affected rows is typically returned by the Delete method for the business object, and that value is available from the ReturnValue property of the ObjectDataSourceStatusEventArgs parameter of the Deleted event handler.

The Delete method calls the ExecuteDelete method, passing the keys and oldValues collections.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: