SPBackupRestoreConsole.DatabaseExists 方法
获取一个值,该值指示指定的数据库是否存在指定的服务器上,并指定用户可以读取。
命名空间: Microsoft.SharePoint.Administration.Backup
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Shared Function DatabaseExists ( _
server As String, _
name As String, _
username As String, _
password As String _
) As Boolean
用法
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
)
参数
server
类型:System.String承载数据库的服务器。
name
类型:System.String数据库的名称。
username
类型:System.String用户的名称。
password
类型:System.String用于访问数据库的用户的密码。
返回值
类型:System.Boolean
true如果数据库存在,并且为可读 ;否则为false。