ConnectionStringSettings Constructor (String, String, String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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
Available since 2.0
Return to top
Show: