Redigera

Dela via


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();
public ConnectionStringSettings ();
Public Sub New ()

See also

Applies to

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(System::String ^ name, System::String ^ connectionString);
public ConnectionStringSettings (string name, string connectionString);
new System.Configuration.ConnectionStringSettings : string * string -> System.Configuration.ConnectionStringSettings
Public Sub New (name As String, connectionString As String)

Parameters

name
String

The name of the connection string.

connectionString
String

The connection string.

See also

Applies to

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(System::String ^ name, System::String ^ connectionString, System::String ^ providerName);
public ConnectionStringSettings (string name, string connectionString, string providerName);
new System.Configuration.ConnectionStringSettings : string * string * string -> System.Configuration.ConnectionStringSettings
Public Sub New (name As String, connectionString As String, providerName As String)

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"));
' Add the connection string.
Dim csSection _
As ConnectionStringsSection = _
config.ConnectionStrings
csSection.ConnectionStrings.Add( _
New ConnectionStringSettings(csName, _
"LocalSqlServer: data source=127.0.0.1;Integrated Security=SSPI;" _
+ "Initial Catalog=aspnetdb", "System.Data.SqlClient"))

See also

Applies to