共用方式為


SPDatabaseServiceInstanceCollection class

代表SPDatabaseServiceInstance物件的集合。

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)

Syntax

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

備註

使用SPDabaseService類別繼承的Instances屬性可傳回SPServiceInstanceDependencyCollection物件,代表所有的資料庫服務執行個體。使用SPDatabaseServiceInstanceCollection建構函式會傳回所有資料庫服務執行個體在特定伺服器上執行的集合。

若要新增至集合中的資料庫服務執行個體,使用Add方法。

若要從集合中傳回單一資料庫服務執行個體使用索引器。例如,若集合已指派給變數 myDatabaseServiceInstances,使用myDatabaseServiceInstances[index]以 C# 或 Visual Basic,其中index是名稱或 GUID 識別的資料庫服務執行個體中的myDatabaseServiceInstances(index) 。

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.

請參閱

參照

SPDatabaseServiceInstanceCollection members

Microsoft.SharePoint.Administration namespace