SPDatabase class
SharePoint 2013
Encapsulates access to Microsoft SQL Server databases.
System.Object
Microsoft.SharePoint.Administration.SPAutoSerializingObject
Microsoft.SharePoint.Administration.SPPersistedObject
Microsoft.SharePoint.Administration.SPPersistedUpgradableObject
Microsoft.SharePoint.Administration.SPDatabase
Microsoft.SharePoint.Administration.SPContentDatabase
Microsoft.SharePoint.Administration.SPUsageDatabase
Microsoft.SharePoint.Administration.SPAutoSerializingObject
Microsoft.SharePoint.Administration.SPPersistedObject
Microsoft.SharePoint.Administration.SPPersistedUpgradableObject
Microsoft.SharePoint.Administration.SPDatabase
Microsoft.SharePoint.Administration.SPContentDatabase
Microsoft.SharePoint.Administration.SPUsageDatabase
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Use the Databases property of the SPDatabaseServiceInstance class, or the SPDatabaseCollection constructor, to return the collection of databases that support a database service instance.
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 that identifies the database.