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


The SQL Server instance associated with the connection.
The default database associated with the connection. A null or empty value indicates the master database.
The SQL Server username.
The SQL Server password.
Returns a connection string with the specified settings.
Syntax
'Declaration
 
Public Overloads Shared Function GetConnectionString( _
   ByVal serverName As System.String, _
   ByVal defaultDatabase As System.String, _
   ByVal username As System.String, _
   ByVal password As System.String _
) As System.String
public static System.string GetConnectionString( 
   System.string serverName,
   System.string defaultDatabase,
   System.string username,
   System.string password
)
public: static System.string* GetConnectionString( 
   System.string* serverName,
   System.string* defaultDatabase,
   System.string* username,
   System.string* password
) 

Parameters

serverName
The SQL Server instance associated with the connection.
defaultDatabase
The default database associated with the connection. A null or empty value indicates the master database.
username
The SQL Server username.
password
The SQL Server password.

Return Value

The connection string.
Exceptions
ExceptionDescription
System.ArgumentNullException

The serverName parameter is null

or

The username parameter is null

System.ArgumentException

The serverName parameter is an empty string

or

The username parameter is an empty string

Remarks
The connection string returned by this method uses SQL Server authentication.
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

SqlConnectionManager Class
SqlConnectionManager Members
Overload List

 

 


┬ęCopyright 2018 xSQL Software. All Rights Reserved.

Send Feedback