SPDatabaseServiceInstanceCollection Class

Represents a collection of SPDatabaseServiceInstance objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPDatabaseServiceInstance>
    Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPDatabaseServiceInstance>
      Microsoft.SharePoint.Administration.SPDatabaseServiceInstanceCollection

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

Syntax

'Declaration
<GuidAttribute("7E394E82-FBED-4529-BC8E-A17E54EFCAB7")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPDatabaseServiceInstanceCollection _
    Inherits SPPersistedChildCollection(Of SPDatabaseServiceInstance)
'Usage
Dim instance As SPDatabaseServiceInstanceCollection
[GuidAttribute("7E394E82-FBED-4529-BC8E-A17E54EFCAB7")]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPDatabaseServiceInstanceCollection : SPPersistedChildCollection<SPDatabaseServiceInstance>

Remarks

Use the inherited Instances property of the SPDabaseService class to return an SPServiceInstanceDependencyCollection object that represents all instances of the database service. Use the SPDatabaseServiceInstanceCollection constructor to return the collection of all database service instances that are running on a specific server.

To add a database service instance to the collection, use the Add method.

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.

See Also

Reference

SPDatabaseServiceInstanceCollection Members

Microsoft.SharePoint.Administration Namespace