SqlConnectionStringBuilder
Provides a simple way to create and manage the contents of connection strings used by the SqlConnection class.
Declares the application workload type when connecting to a database in an SQL Server Availability Group. You can set the value of this property with ApplicationIntent. For more information about SqlClient support for Always On Availability Groups, see SqlClient Support for High Availability, Disaster Recovery.
Gets or sets the name of the application associated with the connection string.
Gets or sets a string that contains the name of the primary data file. This includes the full path name of an attachable database.
The number of reconnections attempted after identifying that there was an idle connection failure. This must be an integer between 0 and 255. Default is 1. Set to 0 to disable reconnecting on idle connection failures. An ArgumentException will be thrown if set to a value outside of the allowed range.
Amount of time (in seconds) between each reconnection attempt after identifying that there was an idle connection failure. This must be an integer between 1 and 60. The default is 10 seconds. An ArgumentException will be thrown if set to a value outside of the allowed range.
Gets or sets the length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.
Gets or sets the SQL Server Language record name.
Gets or sets the name or network address of the instance of SQL Server to connect to.
Gets or sets a Boolean value that indicates whether SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed.
Gets or sets the name or address of the partner server to connect to if the primary server is down.
Gets or sets the name of the database associated with the connection.
Gets or sets a Boolean value that indicates whether User ID and Password are specified in the connection (when false) or whether the current Windows account credentials are used for authentication (when true).
Gets or sets the minimum time, in seconds, for the connection to live in the connection pool before being destroyed.
Gets or sets the maximum number of connections allowed in the connection pool for this specific connection string.
Gets or sets the minimum number of connections allowed in the connection pool for this specific connection string.
When true, an application can maintain multiple active result sets (MARS). When false, an application must process or cancel all result sets from one batch before it can execute any other batch on that connection.
For more information, see Multiple Active Result Sets (MARS).
If your application is connecting to an AlwaysOn availability group (AG) on different subnets, setting MultiSubnetFailover=true provides faster detection of and connection to the (currently) active server. For more information about SqlClient support for Always On Availability Groups, see SqlClient Support for High Availability, Disaster Recovery.
Gets or sets the size in bytes of the network packets used to communicate with an instance of SQL Server.
Gets or sets the password for the SQL Server account.
Gets or sets a Boolean value that indicates if security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.
Gets or sets a Boolean value that indicates whether the connection will be pooled or explicitly opened every time that the connection is requested.
Gets or sets a Boolean value that indicates whether replication is supported using the connection.
Gets or sets a value that indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust.
Gets or sets a string value that indicates the type system the application expects.
Gets or sets the user ID to be used when connecting to SQL Server.
Gets or sets a value that indicates whether to redirect the connection from the default SQL Server Express instance to a runtime-initiated instance running under the account of the caller.
Gets or sets the name of the workstation connecting to SQL Server.
public SqlConnectionStringBuilder()
Initializes a new instance of the SqlConnectionStringBuilder class.
Initializes a new instance of the SqlConnectionStringBuilder class. The provided connection string provides the data for the instance's internal connection information.