Share via


SPDatabaseSnapshotCollection.Item property (String)

Gets the first database snapshot in the collection of database snapshots with the specified name.

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

Syntax

'Declaration
Public ReadOnly Property Item ( _
    snapshotName As String _
) As SPDatabaseSnapshot
    Get
'Usage
Dim instance As SPDatabaseSnapshotCollection
Dim snapshotName As String
Dim value As SPDatabaseSnapshot

value = instance.Item(snapshotName)
public SPDatabaseSnapshot this[
    string snapshotName
] { get; }

Parameters

  • snapshotName
    Type: System.String

    The name of the database snapshot.

Property value

Type: Microsoft.SharePoint.Administration.Backup.SPDatabaseSnapshot
The first database snapshot with the specified name, or a null reference (Nothing in Visual Basic) if there is no database snapshot with that name.

Remarks

Warning

Database snapshots are typically created and deleted automatically by timer jobs in the background. To help ensure that the SPDatabaseSnapshotCollection object represents the current set of database snapshots, always call the RefreshSnapshots() method before you access or process any members of the collection. This point applies also when you access a database snapshot through an indexer. For example, if spd is an SPDatabase object, the line spd.Snapshots["SPFContent1_20090511_111023_8367592"] should be preceded by a call of the RefreshSnapshots() method.

See also

Reference

SPDatabaseSnapshotCollection class

SPDatabaseSnapshotCollection members

Item overload

Microsoft.SharePoint.Administration.Backup namespace