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
server
Type: System.StringThe server that hosts the database.
name
Type: System.StringThe name of the database.
username
Type: System.StringThe name of the user.
password
Type: System.StringThe password of the user for access to the database.
Return Value
Type: System.Boolean
true if the database exists and is readable; otherwise, false.