xSQL Schema Compare SDK version 9.5 for SQL Server
GetConnectionString(String,String,Int32,Boolean,Int32,SqlConnectionProtocolEnum,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 connection timeout.
A bool value that indicates whether the connection should be pooled.
The size, in bytes, of the network packets that should be used to communicate with SQL Server.
The connection protocol.
Other connection properties specified as name=value separated by a semicolon: name1=value1;name2=value2....
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 timeout As System.Integer, _
   ByVal pooled As System.Boolean, _
   ByVal packetSize As System.Integer, _
   ByVal protocol As SqlConnectionProtocolEnum, _
   Optional ByVal otherProperties As System.String _
) As System.String
public static System.string GetConnectionString( 
   System.string serverName,
   System.string defaultDatabase,
   System.int timeout,
   System.bool pooled,
   System.int packetSize,
   SqlConnectionProtocolEnum protocol,
   System.string otherProperties
)
public: static System.string* GetConnectionString( 
   System.string* serverName,
   System.string* defaultDatabase,
   System.int timeout,
   System.bool pooled,
   System.int packetSize,
   SqlConnectionProtocolEnum protocol,
   System.string* otherProperties
) 

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.
timeout
The connection timeout.
pooled
A bool value that indicates whether the connection should be pooled.
packetSize
The size, in bytes, of the network packets that should be used to communicate with SQL Server.
protocol
The connection protocol.
otherProperties
Other connection properties specified as name=value separated by a semicolon: name1=value1;name2=value2....

Return Value

The connection string.
Exceptions
ExceptionDescription
System.ArgumentNullException

The serverName parameter is null

System.ArgumentException

The serverName parameter is an empty string

Remarks
The connection string returned by this method uses Windows 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