Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    Object
    ConnectionStringSettingsCollectionExtensions
    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
    • connectionStringSettingsName - Could not find connection string setting in app.config/web.config.
    • Connection string in app.config/web.config was empty.
    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
    • connectionStringSettingsName - Could not find connection string setting in app.config/web.config.
    • Connection string in app.config/web.config was empty.
    PlatformNotSupportedException

    ConnectionStringSettings are only supported on .NET Framework.

    In This Article
    Back to top Copyright © 2023 Envobi Ltd