Partager via


SPDatabaseService Class

Represents a farm-wide service that stores settings for all instances of SQL Server.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.Administration.SPPersistedObject
      Microsoft.SharePoint.Administration.SPPersistedUpgradableObject
        Microsoft.SharePoint.Administration.SPService
          Microsoft.SharePoint.Administration.SPWindowsService
            Microsoft.SharePoint.Administration.SPDatabaseService

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

<GuidAttribute("90366CC7-06B5-4e15-A616-2FD806648522")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPDatabaseService _
    Inherits SPWindowsService

Dim instance As SPDatabaseService
[GuidAttribute("90366CC7-06B5-4e15-A616-2FD806648522")]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPDatabaseService : SPWindowsService

Remarks

To return the parent database service of a database service instance, use the inherited Service property of the SPDatabaseServiceInstance class.

Use the SPDatabaseServiceCollection constructor to return the collection of database services that are running in a server farm. Use an indexer to return a single database service from the collection. For example, if the collection is assigned to a variable named myDatabaseServices, use myDatabaseServices[index] in C#, or myDatabaseServices(index) in Visual Basic, where index is either the name or the GUID that identifies the database service.

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.

See Also

Reference

SPDatabaseService Members

Microsoft.SharePoint.Administration Namespace