Performs a delete operation on the list of data that the DataSourceView object represents.
Assembly: System.Web (in System.Web.dll)
'Declaration Protected Overridable Function ExecuteDelete ( _ keys As IDictionary, _ oldValues As IDictionary _ ) As Integer
- Type: System.Collections.IDictionary
An IDictionary of object or row keys to be deleted by the operation.
Return ValueType: System.Int32
The number of items that were deleted from the underlying data storage.
Data-bound controls can determine whether the operation is supported by a data source control by retrieving the DataSourceView object using the DataSourceControl.GetView method, and checking the 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 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.
The following code example demonstrates how a class that extends the DataSourceView class can override the CanDelete property and the method. This code example is part of a larger example provided for the DataSourceView class.
' The CsvDataSourceView does not currently ' permit deletion. You can modify or extend ' this sample to do so. Public Overrides ReadOnly Property CanDelete() As Boolean Get Return False End Get End Property Protected Overrides Function ExecuteDelete(keys As IDictionary, values As IDictionary) As Integer Throw New NotSupportedException() End Function 'ExecuteDelete
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.