System.Web.UI.DataSourceView.ExecuteDelete Method

Performs a delete operation on the list of data that the System.Web.UI.DataSourceView object represents.

Syntax

protected virtual int ExecuteDelete (IDictionary keys, IDictionary values)

Parameters

values
Documentation for this section has not yet been entered.
keys
An IDictionary of object or row keys to be deleted by the DataSourceView.ExecuteDelete(IDictionary, IDictionary) operation.

Returns

The number of items that were deleted from the underlying data storage.

Remarks

Data-bound controls can determine whether the DataSourceView.ExecuteDelete(IDictionary, IDictionary) operation is supported by a data source control by retrieving the System.Web.UI.DataSourceView object using the DataSourceControl.GetView(string) method, and checking the DataSourceView.CanDelete property.

The keys parameter represents the object or row keys of the data to delete. For data sources that represent relational data, such as the System.Web.UI.WebControls.SqlDataSource control, the keys parameter is a collection of database primary keys. In other scenarios, the keys parameter is a collection of name/value pairs and is used to filter a list of data. Any data matching a name/value pair is deleted.

Note:

The System.Web.UI.DataSourceView class's default implementation is to throw a NotSupportedException exception. If you extend the System.Web.UI.DataSourceView class, override the DataSourceView.ExecuteDelete(IDictionary, IDictionary) method if your class supports deletion from the underlying data storage.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0