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


The name of the database.
The connection string that contains credentials and other settings to connect to the database.
Returns a database object with the specified name and the connection string.
Syntax
'Declaration
 
Public Overloads Function GetDatabase( _
   ByVal dbName As System.String, _
   ByVal connectionString As System.String _
) As SqlDatabase
public SqlDatabase GetDatabase( 
   System.string dbName,
   System.string connectionString
)
public: SqlDatabase* GetDatabase( 
   System.string* dbName,
   System.string* connectionString
) 

Parameters

dbName
The name of the database.
connectionString
The connection string that contains credentials and other settings to connect to the database.

Return Value

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

The dbName parameter is empty or null

or

The connectionString parameter is empty or null

SchemaExceptionThe database is not found.
Remarks
Call this method when you wish to use a dedicated connection for the database rather than the credentials of the parent SQL Server.
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 2018 xSQL Software. All Rights Reserved.

Send Feedback