共用方式為


SPDatabaseCollection class

代表SPDatabase物件的集合。

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPDatabase>
    Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPDatabase>
      Microsoft.SharePoint.Administration.SPDatabaseCollection

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

Syntax

'宣告
<GuidAttribute("B8AAC2DE-4DD1-49fa-8D6C-B369ED1B906E")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPDatabaseCollection _
    Inherits SPPersistedChildCollection(Of SPDatabase)
'用途
Dim instance As SPDatabaseCollection
[GuidAttribute("B8AAC2DE-4DD1-49fa-8D6C-B369ED1B906E")]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPDatabaseCollection : SPPersistedChildCollection<SPDatabase>

備註

使用Databases屬性SPDatabaseServiceInstance類別或SPDatabaseCollection建構函式,來傳回支援的資料庫服務執行個體的資料庫集合。

若要將資料庫新增至集合中,使用Add方法。

若要從集合中傳回單一資料庫使用索引器。例如,若集合已指派給變數 myDatabases,使用myDatabases[index]以 C# 或 Visual Basic,其中index是名稱或 GUID 識別資料庫中的myDatabases(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.

請參閱

參照

SPDatabaseCollection members

Microsoft.SharePoint.Administration namespace