SqlConnectionStringBuilder Constructors

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Initializes a new instance of the SqlConnectionStringBuilder class.

Overloads

SqlConnectionStringBuilder()

Initializes a new instance of the SqlConnectionStringBuilder class.

SqlConnectionStringBuilder(String)

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

SqlConnectionStringBuilder()

Source:
System.Data.SqlClient.notsupported.cs

Initializes a new instance of the SqlConnectionStringBuilder class.

C#
public SqlConnectionStringBuilder();

See also

Applies to

.NET 10 (package-provided) i druge verzije
Proizvod Verzije
.NET Core 1.0, Core 1.1, 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

SqlConnectionStringBuilder(String)

Source:
System.Data.SqlClient.notsupported.cs

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

C#
public SqlConnectionStringBuilder(string connectionString);

Parameters

connectionString
String

The basis for the object's internal connection information. Parsed into name/value pairs. Invalid key names raise KeyNotFoundException.

Exceptions

Invalid key name within the connection string.

Invalid value within the connection string (specifically, when a Boolean or numeric value was expected but not supplied).

The supplied connectionString is not valid.

Remarks

The SqlConnectionStringBuilder class provides a fixed internal collection of key/value pairs. Even if you supply only a small subset of the possible connection string values in the constructor, the object always provides default values for each key/value pair. When the ConnectionString property of the object is retrieved, the string contains only key/value pairs in which the value is not the default value for the item.

See also

Applies to

.NET 10 (package-provided) i druge verzije
Proizvod Verzije
.NET Core 1.0, Core 1.1, 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)