xSQL Schema Compare SDK for SQL Server version 12
GetDatabase(String,String,String) Method


The name of the database.
The username to connect to the database.
The password to connect to the database. The password can be empty.
Returns a database object with the specified name, username and password. The connection uses the SQL Server Authentication.
Syntax
'Declaration
 
Public Overloads Function GetDatabase( _
   ByVal dbName As System.String, _
   ByVal username As System.String, _
   ByVal password As System.String _
) As SqlDatabase
public SqlDatabase GetDatabase( 
   System.string dbName,
   System.string username,
   System.string password
)
public: SqlDatabase* GetDatabase( 
   System.string* dbName,
   System.string* username,
   System.string* password
) 

Parameters

dbName
The name of the database.
username
The username to connect to the database.
password
The password to connect to the database. The password can be empty.

Return Value

A SqlDatabase object with the specified name.
Exceptions
ExceptionDescription
System.ArgumentNullException

The dbName parameter is null

or

The username parameter is null

System.ArgumentException

The dbName parameter is an empty string

or

The username parameter is an empty string

SchemaExceptionThe database is not found.
Remarks
Call this method when you wish to use a dedicated connection for the database instead of the parent SQL Server connection.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SqlServer Class
SqlServer Members
Overload List

 

 


©Copyright 2022 xSQL Software. All Rights Reserved.

Send Feedback