SPDatabaseCollection Class
Represents a collection of SPDatabase objects.
System.Object
Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPDatabase>
Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPDatabase>
Microsoft.SharePoint.Administration.SPDatabaseCollection
Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPDatabase>
Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPDatabase>
Microsoft.SharePoint.Administration.SPDatabaseCollection
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Use the Databases property of the SPDatabaseServiceInstance class, or the SPDatabaseCollection constructor, to return the collection of databases that support a database service instance.
To add a database to the collection, use the Add method.
Use an indexer to return a single database from the collection. For example, if the collection is assigned to a variable named myDatabases, use myDatabases[index] in C#, or myDatabases(index) in Visual Basic, where index is either the name or the GUID identifying the database.