SPContentDatabase.CreateUnattachedContentDatabase 方法 (String, String, String, String)

通过使用指定的连接信息,而无需在服务器场的配置数据库中注册它创建一个内容数据库。

命名空间:  Microsoft.SharePoint.Administration
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
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
    类型:System.String

    数据库实例,如Server/Microsoft##SSEEMirror,不是物理服务器承载它的名称的名称。

  • username
    类型:System.String

    将登录到该数据库的用户名。

返回值

类型:Microsoft.SharePoint.Administration.SPContentDatabase
内容数据库中。

备注

通常情况下,未连接的内容数据库用于数据恢复方案,并以获取孤立的网站集和网站。

如果不使用 SQL 身份验证,然后username和password可以是空引用(无 在 Visual Basic 中)或空字符串。

另请参阅

引用

SPContentDatabase 类

SPContentDatabase 成员

CreateUnattachedContentDatabase 重载

Microsoft.SharePoint.Administration 命名空间

其他资源

Fine-grained Data Restoration from Unattached Database