Share via


SPBackupRestoreConsole.DatabaseExists Method

Gets a value that indicates whether the specified database exists on the specified server and can be read by the specified user.

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

Syntax

'Declaration
Public Shared Function DatabaseExists ( _
    server As String, _
    name As String, _
    username As String, _
    password As String _
) As Boolean
'Usage
Dim server As String
Dim name As String
Dim username As String
Dim password As String
Dim returnValue As Boolean

returnValue = SPBackupRestoreConsole.DatabaseExists(server, _
    name, username, password)
public static bool DatabaseExists(
    string server,
    string name,
    string username,
    string password
)

Parameters

  • password
    Type: System.String

    The password of the user for access to the database.

Return Value

Type: System.Boolean
true if the database exists and is readable; otherwise, false.

See Also

Reference

SPBackupRestoreConsole Class

SPBackupRestoreConsole Members

Microsoft.SharePoint.Administration.Backup Namespace