<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />

SqlConnectionStringBuilder

Provides a simple way to create and manage the contents of connection strings used by the SqlConnection class.
public ApplicationIntent ApplicationIntent { get; set; }

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.

public string ApplicationName { get; set; }

Gets or sets the name of the application associated with the connection string.

public string AttachDBFilename { get; set; }

Gets or sets a string that contains the name of the primary data file. This includes the full path name of an attachable database.

public int ConnectRetryCount { get; set; }

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.

public int ConnectRetryInterval { get; set; }

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.

public int ConnectTimeout { get; set; }

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.

public string CurrentLanguage { get; set; }

Gets or sets the SQL Server Language record name.

public string DataSource { get; set; }

Gets or sets the name or network address of the instance of SQL Server to connect to.

public bool Encrypt { get; set; }

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.

public string FailoverPartner { get; set; }

Gets or sets the name or address of the partner server to connect to if the primary server is down.

public string InitialCatalog { get; set; }

Gets or sets the name of the database associated with the connection.

public bool IntegratedSecurity { get; set; }

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).

public int LoadBalanceTimeout { get; set; }

Gets or sets the minimum time, in seconds, for the connection to live in the connection pool before being destroyed.

public int MaxPoolSize { get; set; }

Gets or sets the maximum number of connections allowed in the connection pool for this specific connection string.

public int MinPoolSize { get; set; }

Gets or sets the minimum number of connections allowed in the connection pool for this specific connection string.

public bool MultipleActiveResultSets { get; set; }

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).

public bool MultiSubnetFailover { get; set; }

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.

public int PacketSize { get; set; }

Gets or sets the size in bytes of the network packets used to communicate with an instance of SQL Server.

public string Password { get; set; }

Gets or sets the password for the SQL Server account.

public bool PersistSecurityInfo { get; set; }

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.

public bool Pooling { get; set; }

Gets or sets a Boolean value that indicates whether the connection will be pooled or explicitly opened every time that the connection is requested.

public bool Replication { get; set; }

Gets or sets a Boolean value that indicates whether replication is supported using the connection.

public bool TrustServerCertificate { get; set; }

Gets or sets a value that indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust.

public string TypeSystemVersion { get; set; }

Gets or sets a string value that indicates the type system the application expects.

public string UserID { get; set; }

Gets or sets the user ID to be used when connecting to SQL Server.

public bool UserInstance { get; set; }

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.

public string WorkstationID { get; set; }

Gets or sets the name of the workstation connecting to SQL Server.

Initializes a new instance of the SqlConnectionStringBuilder class.

public SqlConnectionStringBuilder(string connectionString)

Initializes a new instance of the SqlConnectionStringBuilder class. The provided connection string provides the data for the instance's internal connection information.