SPChangeTokenCollection.Delete method

Deletes the change token object with the specified ID from the collection.

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


Public Sub Delete ( _
    scopeId As Guid _
Dim instance As SPChangeTokenCollection
Dim scopeId As Guid

public void Delete(
    Guid scopeId


  • scopeId
    Type: System.Guid

    The ID of the change token to delete.


If the collection does not contain a change token with the specified scopeId value, the collection remains unchanged. No exception is thrown.

You can get a value to pass as an argument to this method by accessing the Id property of the object to which the change token applies. For example, if you have a collection of change tokens for several content databases and you decide not to monitor changes for a particular database, you can delete its token from the collection by passing the GUID that identifies the content database. To get this GUID, first cast the SPContentDatabase object as type SPPersistedObject, and then access the resulting object’s Id property. The following code example demonstrates this technique.

Dim db As SPPersistedObject = CType(oSPSite.ContentDatabase, SPPersistedObject)
SPPersistedObject db = oSPSite.ContentDatabase as SPPersistedObject;

The cast is necessary because the Id property of the SPContentDatabase class is obsolete.

See also


SPChangeTokenCollection class

SPChangeTokenCollection members

Microsoft.SharePoint namespace