SPDatabaseServiceInstance class
Represents a named SQL Server instance.
Inheritance hierarchy
System.Object
Microsoft.SharePoint.Administration.SPAutoSerializingObject
Microsoft.SharePoint.Administration.SPPersistedObject
Microsoft.SharePoint.Administration.SPPersistedUpgradableObject
Microsoft.SharePoint.Administration.SPServiceInstance
Microsoft.SharePoint.Administration.SPDatabaseServiceInstance
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
<GuidAttribute("3112E92F-B97D-481e-8CEB-03FDE15ED1A7")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPDatabaseServiceInstance _
Inherits SPServiceInstance
'Usage
Dim instance As SPDatabaseServiceInstance
[GuidAttribute("3112E92F-B97D-481e-8CEB-03FDE15ED1A7")]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPDatabaseServiceInstance : SPServiceInstance
Remarks
Use the inherited Instances property of the SPDatabaseService class to return an SPServiceInstanceDependencyCollection object that represents all instances of the database service. Use the SPDatabaseServiceInstanceCollection constructor to return the collection of database service instances that are running on a specific server.
Use an indexer to return a single database service instance from the collection. For example, if the collection is assigned to a variable named myDatabaseServiceInstances, use myDatabaseServiceInstances[index] in C#, or myDatabaseServiceInstances(index) in Visual Basic, where index is either the name or the GUID identifying the database service instance.
Thread safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.