ConnectionHelper.BuildConnectionString Method |
Builds a connection string based on specified parameters.
Namespace: CMS.DataEngineAssembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 10.0.0
Syntaxpublic 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.DataEngine.SQLServerAuthenticationModeEnum
Authentication type - serverName
- Type: System.String
The name or network address of the instance of SQL Server to which to connect. - databaseName
- Type: System.String
The name of the database. Can be null or String.Empty. - userName
- Type: System.String
User name (used only with SQLServerAuthentication) - password
- Type: System.String
User password (used only with SQLServerAuthentication) - timeout
- Type: System.Int32
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: System.String
Connection language. If not provided, "English" is used. - isForAzure (Optional)
- Type: System.Boolean
If true, connection string is meant to be used with Microsoft Azure.
Return Value
Type:
String
Exceptions
See Also