ConnectionStringSettings Constructors

Definition

Initializes a new instance of the ConnectionStringSettings class.

Overloads

ConnectionStringSettings()

Initializes a new instance of the ConnectionStringSettings class.

ConnectionStringSettings(String, String)

Initializes a new instance of the ConnectionStringSettings class.

ConnectionStringSettings(String, String, String)

Initializes a new instance of the ConnectionStringSettings class.

ConnectionStringSettings()

Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs

Initializes a new instance of the ConnectionStringSettings class.

public ConnectionStringSettings ();

See also

Applies to

.NET 9 (package-provided) およびその他のバージョン
製品 バージョン
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

ConnectionStringSettings(String, String)

Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs

Initializes a new instance of the ConnectionStringSettings class.

public ConnectionStringSettings (string name, string connectionString);

Parameters

name
String

The name of the connection string.

connectionString
String

The connection string.

See also

Applies to

.NET 9 (package-provided) およびその他のバージョン
製品 バージョン
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

ConnectionStringSettings(String, String, String)

Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs
Source:
ConnectionStringSettings.cs

Initializes a new instance of the ConnectionStringSettings class.

public ConnectionStringSettings (string name, string connectionString, string providerName);

Parameters

name
String

The name of the connection string.

connectionString
String

The connection string.

providerName
String

The name of the provider to use with the connection string.

Examples

The following example shows how to create a ConnectionStringSettings object and add it to a ConnectionStringSettingsCollection collection.

// Add the connection string.
ConnectionStringsSection csSection =
    config.ConnectionStrings;
csSection.ConnectionStrings.Add(
    new ConnectionStringSettings(csName,
        "LocalSqlServer: data source=127.0.0.1;Integrated Security=True;" +
        "Initial Catalog=aspnetdb", "System.Data.SqlClient"));

See also

Applies to

.NET 9 (package-provided) およびその他のバージョン
製品 バージョン
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9