Share via


SPDataSourceView.ExecuteDelete method

Deletes a list item.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Protected Overrides Function ExecuteDelete ( _
    keys As IDictionary, _
    values As IDictionary _
) As Integer
'Usage
Dim keys As IDictionary
Dim values As IDictionary
Dim returnValue As Integer

returnValue = Me.ExecuteDelete(keys, _
    values)
protected override int ExecuteDelete(
    IDictionary keys,
    IDictionary values
)

Parameters

  • keys
    Type: System.Collections.IDictionary

    A dictionary that contains at least one key/value pair. The value of the first pair should be the ID property value of the list item to delete.

  • values
    Type: System.Collections.IDictionary

    A dictionary object. The value can be a null reference (Nothing in Visual Basic) as this implementation of the ExecuteDelete method ignores the second parameter.

Return value

Type: System.Int32
A System.Int32 value that is the number of items deleted. In this implementation, the return value is either 0 or 1.

Exceptions

Exception Condition
NotSupportedException

The current view does not support delete operations.

Remarks

The ExecuteDelete method deletes a single list item. The method first tries to identify the item from the context by examining the DeleteParametersDictionary property. Then, if no item is identified, the method examines the first key in the IDictionary object passed as an argument to the keys parameter.

See also

Reference

SPDataSourceView class

SPDataSourceView members

Microsoft.SharePoint.WebControls namespace

DeleteCommand

DeleteParameters

CanDelete