Class ConnectionStringSettingsCollectionExtensions
Note: .NET Framework only.
Utility extension methods for getting database provider details from a ConnectionStringSettingsCollection instance, typically loaded from an "app.config" or "web.config" file. Also see ConfigurationManager.
Namespace: actionETL.Adb
Assembly: actionETL.dll
Syntax
public static class ConnectionStringSettingsCollectionExtensions
Methods
GetConnectionString(ConnectionStringSettingsCollection, String)
Note: .NET Framework only.
Gets the connection string from the collection, which has typically been loaded from an "app.config" or "web.config" file.
Declaration
public static string GetConnectionString(this ConnectionStringSettingsCollection connectionStringSettingsCollection, string connectionStringSettingsName)
Parameters
| Type | Name | Description |
|---|---|---|
| ConnectionStringSettingsCollection | connectionStringSettingsCollection | The connection string settings collection. |
| String | connectionStringSettingsName | Name of the connection string settings. |
Returns
| Type | Description |
|---|---|
| String | The connection string. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException |
|
| PlatformNotSupportedException | ConnectionStringSettings are only supported on .NET Framework. |
GetProviderInvariantName(ConnectionStringSettingsCollection, String)
Note: .NET Framework only.
Gets the ProviderName invariant name of the provider from the collection, which has typically been loaded from an "app.config" or "web.config" file.
Declaration
public static string GetProviderInvariantName(this ConnectionStringSettingsCollection connectionStringSettingsCollection, string connectionStringSettingsName)
Parameters
| Type | Name | Description |
|---|---|---|
| ConnectionStringSettingsCollection | connectionStringSettingsCollection | The connection string settings collection. |
| String | connectionStringSettingsName | Name of the connection string settings. |
Returns
| Type | Description |
|---|---|
| String | The provider name. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException |
|
| PlatformNotSupportedException | ConnectionStringSettings are only supported on .NET Framework. |