SPContentDatabaseCollection.Add method (String, String, String, String, Int32, Int32, Int32, Boolean, Boolean)

Adds a content database to the collection of content databases that are used by the parent Web application based on specified database settings.

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

Syntax

'Declaration
Public Function Add ( _
    strDatabaseServer As String, _
    strDatabaseName As String, _
    strDatabaseUsername As String, _
    strDatabasePassword As String, _
    warningSiteCount As Integer, _
    maximumSiteCount As Integer, _
    status As Integer, _
    flushChangeLog As Boolean, _
    changeSyncKnowledge As Boolean _
) As SPContentDatabase
'Usage
Dim instance As SPContentDatabaseCollection
Dim strDatabaseServer As String
Dim strDatabaseName As String
Dim strDatabaseUsername As String
Dim strDatabasePassword As String
Dim warningSiteCount As Integer
Dim maximumSiteCount As Integer
Dim status As Integer
Dim flushChangeLog As Boolean
Dim changeSyncKnowledge As Boolean
Dim returnValue As SPContentDatabase

returnValue = instance.Add(strDatabaseServer, _
    strDatabaseName, strDatabaseUsername, _
    strDatabasePassword, warningSiteCount, _
    maximumSiteCount, status, flushChangeLog, _
    changeSyncKnowledge)
public SPContentDatabase Add(
    string strDatabaseServer,
    string strDatabaseName,
    string strDatabaseUsername,
    string strDatabasePassword,
    int warningSiteCount,
    int maximumSiteCount,
    int status,
    bool flushChangeLog,
    bool changeSyncKnowledge
)

Parameters

  • strDatabaseServer
    Type: System.String

    A string that contains the name of the server for the database.

  • strDatabaseName
    Type: System.String

    A string that contains the name for the database.

  • strDatabaseUsername
    Type: System.String

    A string that contains the name of the owner for the database.

  • strDatabasePassword
    Type: System.String

    A string that contains the password for accessing the database.

  • warningSiteCount
    Type: System.Int32

    A 32-bit integer that specifies the number of sites that can be created before a warning event is generated and e-mail notification is sent to the database administrators.

  • maximumSiteCount
    Type: System.Int32

    A 32-bit integer that specifies the maximum number of sites to represent in the content database.

  • status
    Type: System.Int32

    A 32-bit integer that specifies the status for the database. 0 to set the status of the new database to Ready; otherwise, 1 to set the status to Offline, which means that no new sites can be created in the database.

  • flushChangeLog
    Type: System.Boolean

    A boolean value representing whether at attachment time the database should flush the change log or not. If the database ever existed or the database is being replaced (e.g. a catastrophic restore) then this value should be true. If this database never existed in the farm then false.

  • changeSyncKnowledge
    Type: System.Boolean

    A boolean value representing whether the LastModifiedTimeForSync property on the SPContentDatabase should be updated to the current time.

Return value

Type: Microsoft.SharePoint.Administration.SPContentDatabase

See also

Reference

SPContentDatabaseCollection class

SPContentDatabaseCollection members

Add overload

Microsoft.SharePoint.Administration namespace