共用方式為


SPDatabase.Snapshots Property

Gets the snapshots of the database.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public ReadOnly Property Snapshots As SPDatabaseSnapshotCollection
    Get
'Usage
Dim instance As SPDatabase
Dim value As SPDatabaseSnapshotCollection

value = instance.Snapshots
public SPDatabaseSnapshotCollection Snapshots { get; }

Property Value

Type: Microsoft.SharePoint.Administration.Backup.SPDatabaseSnapshotCollection
All of the currently existing snapshots of the database.

Remarks

Typically, administrators set snapshots to be taken on a regularly scheduled basis. In addition, snapshots have a fixed lifespan, usually measured in hours, after which they go out of existence. Hence, the membership of this property is highly dynamic.

The collection may be empty, but the property never returns a a null reference (Nothing in Visual Basic) reference.

Note

Only the Enterprise and Developer editions of Microsoft SQL Server support database snapshots.

Warning

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 snapshots, always call the RefreshSnapshots() method before you access or process any members of the collection. This point applies also when you access a snapshot through an indexer. For example, if spd is an SPDatabase object, the line spd.Snapshots[0] should be preceded by a call of the RefreshSnapshots() method.

See Also

Reference

SPDatabase Class

SPDatabase Members

Microsoft.SharePoint.Administration Namespace