Compartilhar via


SPDatabaseServiceCollection Class

Represents a collection of SPDatabaseService objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPDatabaseService>
    Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPDatabaseService>
      Microsoft.SharePoint.Administration.SPDatabaseServiceCollection

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPDatabaseServiceCollection _
    Inherits SPPersistedChildCollection(Of SPDatabaseService)
'Usage
Dim instance As SPDatabaseServiceCollection
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPDatabaseServiceCollection : SPPersistedChildCollection<SPDatabaseService>

Remarks

Use the SPDatabaseServiceCollection constructor to return the collection of database services that are running in a server farm. To add a database service to the collection, use the Add method.

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 identifying 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

SPDatabaseServiceCollection Members

Microsoft.SharePoint.Administration Namespace