Performs a delete operation by calling the business object method that is identified by the ObjectDataSourceView.DeleteMethod property using the specified keys and oldValues collections.
- keys
- A IDictionary of the key values used to identify the item to delete. These parameters are used with the ObjectDataSourceView.DeleteMethod property to perform the delete operation. If there are no parameters associated with the method, pass null.
- oldValues
- 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 ObjectDataSourceView.ConflictDetection property is set to the System.Web.UI.ConflictOptions.CompareAllValues field.
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 ObjectDataSourceStatusEventArgs.AffectedRows property of the System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs object of the ObjectDataSource.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 ObjectDataSourceStatusEventArgs.ReturnValue property of the System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs parameter of the ObjectDataSource.Deleted event handler.
The ObjectDataSourceView.Delete(IDictionary, IDictionary) method calls the ObjectDataSourceView.ExecuteDelete(IDictionary, IDictionary) method, passing the keys and oldValues collections.