SPDatabaseSnapshotCollection.RefreshSnapshots method
Queries the database to ensure that the SPDatabaseSnapshotCollection object represents the current list of all database snapshots of the database.
Namespace: Microsoft.SharePoint.Administration.Backup
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Sub RefreshSnapshots
'Usage
Dim instance As SPDatabaseSnapshotCollection
instance.RefreshSnapshots()
public void RefreshSnapshots()
Remarks
The population of database snapshots for a database is highly dynamic because new database snapshots are created on a regular schedule and old database snapshots are deleted automatically when they reach their maximum allowed age. For this reason, the membership of an SPDatabaseSnapshotCollection object can become out-of-date. Use the RefreshSnapshots() method to ensure that, for example, the Count property is accurate and that the Snapshots property of the parent SPDatabase object is accurate.
The RefreshSnapshots() method makes a round trip to Microsoft SQL Server and can decrease performance if called frequently. For example, if you are iterating over items in the collection, calling RefreshSnapshots() can decrease performance.
See also
Reference
SPDatabaseSnapshotCollection class