SPContentDatabase.CreateUnattachedContentDatabase method (String, String, String, String)
建立內容資料庫物件,使用指定的連線資訊,而不將其登錄伺服器陣列設定資料庫中。
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Shared Function CreateUnattachedContentDatabase ( _
databaseInstanceServer As String, _
databaseName As String, _
username As String, _
password As String _
) As SPContentDatabase
'用途
Dim databaseInstanceServer As String
Dim databaseName As String
Dim username As String
Dim password As String
Dim returnValue As SPContentDatabase
returnValue = SPContentDatabase.CreateUnattachedContentDatabase(databaseInstanceServer, _
databaseName, username, password)
public static SPContentDatabase CreateUnattachedContentDatabase(
string databaseInstanceServer,
string databaseName,
string username,
string password
)
參數
databaseInstanceServer
Type: System.String資料庫執行個體名稱,例如Server/Microsoft##SSEEMirror,不會主控實體伺服器的名稱。
databaseName
Type: System.String資料庫名稱。
username
Type: System.String將登入資料庫使用者名稱。
password
Type: System.String使用者的密碼。
傳回值
Type: Microsoft.SharePoint.Administration.SPContentDatabase
內容資料庫。
備註
一般而言,從未附加的內容資料庫可用的資料修復案例,並取得孤立的網站集合與網站。
如果不使用 SQL 驗證,然後username和password可a null reference (Nothing in Visual Basic)或空字串。
請參閱
參照
CreateUnattachedContentDatabase overload
Microsoft.SharePoint.Administration namespace