SqlDataSourceView.ExecuteDelete Method (IDictionary, IDictionary)
Performs a delete operation using the DeleteCommand SQL string, any parameters that are specified in the DeleteParameters collection, and the values that are in the specified keys and oldValues collections.
Assembly: System.Web (in System.Web.dll)
An IDictionary of object or row key values for the operation to delete.
Return ValueType: System.Int32
A value that represents the number of rows deleted from the underlying database.
The SqlDataSourceView class implements the inherited ExecuteDelete method to delete data from a database. Page developers and data-bound control authors do not call the method directly; instead, use the publicly exposed Delete method.
The values that are contained in the keys collection are evaluated and merged with any values that are contained by the DeleteParameters collection. If the ConflictDetection property is set to the CompareAllValues value, the values that are contained in the oldValues collection are formatted with the OldValuesParameterFormatString property and are also merged.
Before the delete operation is performed, the OnDeleting method is called to raise the Deleting event. You can handle this event to examine the values of the parameters and to perform any preprocessing before a delete.
To perform a delete operation, the SqlDataSourceView object builds a DbCommand object using the DeleteCommand text and any associated DeleteParameters properties, and then executes the DbCommand object against the underlying database. After the delete operation completes, the OnDeleted method is called to raise the Deleted event. You can handle this event to examine any return values and error codes and to perform any post-processing.
Available since 2.0