SPContentDatabase.CreateUnattachedContentDatabase method (SqlConnectionStringBuilder)
Creates a content database object, from the database with the specified connection string, without registering it in the configuration database of the farm.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Shared Function CreateUnattachedContentDatabase ( _
connection As SqlConnectionStringBuilder _
) As SPContentDatabase
'Usage
Dim connection As SqlConnectionStringBuilder
Dim returnValue As SPContentDatabase
returnValue = SPContentDatabase.CreateUnattachedContentDatabase(connection)
public static SPContentDatabase CreateUnattachedContentDatabase(
SqlConnectionStringBuilder connection
)
Parameters
connection
Type: System.Data.SqlClient.SqlConnectionStringBuilderA connection string to a content database.
Return value
Type: Microsoft.SharePoint.Administration.SPContentDatabase
The content database.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The connection parameter is a null reference (Nothing in Visual Basic). |
Remarks
Typically, unattached content databases are used for data recovery scenarios and to get orphaned site collections and sites.
See also
Reference
CreateUnattachedContentDatabase overload
Microsoft.SharePoint.Administration namespace