Export (0) Print
Expand All

ConnectionStringSettings Constructor (String, String, String)

Initializes a new instance of a ConnectionStringSettings object.

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

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

Parameters

name
Type: System.String

The name of the connection string.

connectionString
Type: System.String

The connection string.

providerName
Type: System.String

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

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=SSPI;" +
        "Initial Catalog=aspnetdb", "System.Data.SqlClient"));

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft