Class ConnectionStringParser
Utility class for connection string parsing.
Inheritance
System.Object
ConnectionStringParser
Namespace: MESL.SqlRace.Domain
Assembly: MESL.SqlRace.Domain.dll
Syntax
public static class ConnectionStringParser : Object
Remarks
This utility class can be used to create SQL Server 2008 database connections and remote connection strings.
Remote connections are used when connecting to a remote instance of SQL Race server. Example:
- SqlRaceServer:RemoteIpAddress=192.168.2.1#Port=5099#LocalConnectionString=
Database connection strings are used for either a local or remote SQL Server instance. Example:
- Data Source=.\sqlexpress;Initial Catalog=SQLRACE01;Integrated Security=SSPI
Methods
BuildRemoteConnectionString(String, Int32, String)
Builds a SQL Race Server remote connection string.
Declaration
public static string BuildRemoteConnectionString(string remoteIpAddress, int portNumber, string localConnectionString)
Parameters
Type | Name | Description |
---|---|---|
System.String | remoteIpAddress | The remote TCP/IP address. |
System.Int32 | portNumber | The port number. |
System.String | localConnectionString |
Returns
Type | Description |
---|---|
System.String | SQL Race Server remote connection string. |
BuildSqlServerDatabaseConnectionString(String)
Builds a SQL server database connection string.
Declaration
public static string BuildSqlServerDatabaseConnectionString(string serverName)
Parameters
Type | Name | Description |
---|---|---|
System.String | serverName | Name of the server. |
Returns
Type | Description |
---|---|
System.String | A SQL Server database connection string. |
BuildSqlServerDatabaseConnectionString(String, String)
Builds a SQL server database connection string.
Declaration
public static string BuildSqlServerDatabaseConnectionString(string serverName, string databaseName)
Parameters
Type | Name | Description |
---|---|---|
System.String | serverName | Name of the server. |
System.String | databaseName | Name of the database. |
Returns
Type | Description |
---|---|
System.String | A SQL Server database connection string. |