ConnectionHelperBuildConnectionString Method |
Builds a connection string based on specified parameters.
Namespace: CMS.DataEngineAssembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 13.0.131
Syntax public static string BuildConnectionString(
SQLServerAuthenticationModeEnum authenticationMode,
string serverName,
string databaseName,
string userName,
string password,
int timeout,
string language = null,
bool isForAzure = false
)
Parameters
- authenticationMode
- Type: CMS.DataEngineSQLServerAuthenticationModeEnum
Authentication type - serverName
- Type: SystemString
The name or network address of the instance of SQL Server to which to connect. - databaseName
- Type: SystemString
The name of the database. Can be null or String.Empty. - userName
- Type: SystemString
User name (used only with SQLServerAuthentication) - password
- Type: SystemString
User password (used only with SQLServerAuthentication) - timeout
- Type: SystemInt32
The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error. - language (Optional)
- Type: SystemString
Connection language. If not provided, "English" is used. - isForAzure (Optional)
- Type: SystemBoolean
If true, connection string is meant to be used with Microsoft Azure.
Return Value
Type:
StringExceptions Exception | Condition |
---|
ArgumentException | Thrown when serverName is null or String.Empty. |
See Also