Search Results for

    Show / Hide Table of Contents

    Class AdbSqlClientDataSourceInformationService

    Provides information about a SQL Server® data source behind a connection, such as what character to use for quoting, how to specify parameter markers etc. The information is mainly taken from the "DataSourceInformation" schema collection, and is used to write provider-independent database code.

    This class is used when creating AdbProvider instances, use one of the Get() overloads to retrieve the required delegate.

    This class can be inherited to overwrite some values, and used to create a custom Microsoft.Data.SqlClient provider, see AdbSqlClientProvider and Information for details.

    This class is immutable. This avoids threading issues, since an instance is often accessed by multiple threads. Any user custom provider services should also be immutable for the same reason.

    Inheritance
    Object
    AdbGenericDataSourceInformationService
    AdbSqlClientDataSourceInformationService
    Implements
    IAdbDataSourceInformationService
    Inherited Members
    AdbGenericDataSourceInformationService.CompositeIdentifierSeparator
    AdbGenericDataSourceInformationService.Connection
    AdbGenericDataSourceInformationService.GetPlaceholder(String)
    AdbGenericDataSourceInformationService.IdentifierQuotePrefix
    AdbGenericDataSourceInformationService.IdentifierQuotePrefixes
    AdbGenericDataSourceInformationService.IdentifierQuoteSuffix
    AdbGenericDataSourceInformationService.IdentifierQuoteSuffixes
    AdbGenericDataSourceInformationService.ParameterMarker
    AdbGenericDataSourceInformationService.QuoteIdentifierPart(String)
    AdbGenericDataSourceInformationService.StripParameterMarker(String)
    AdbGenericDataSourceInformationService.UsesPositionalParameters
    AdbGenericDataSourceInformationService.CompositeIdentifierSeparatorPattern
    AdbGenericDataSourceInformationService.DataSourceProductName
    AdbGenericDataSourceInformationService.DataSourceProductVersion
    AdbGenericDataSourceInformationService.DataSourceProductVersionNormalized
    AdbGenericDataSourceInformationService.GroupByBehavior
    AdbGenericDataSourceInformationService.IdentifierCase
    AdbGenericDataSourceInformationService.IdentifierPattern
    AdbGenericDataSourceInformationService.OrderByColumnsInSelect
    AdbGenericDataSourceInformationService.ParameterMarkerFormat
    AdbGenericDataSourceInformationService.ParameterMarkerPattern
    AdbGenericDataSourceInformationService.ParameterNameMaxLength
    AdbGenericDataSourceInformationService.ParameterNamePattern
    AdbGenericDataSourceInformationService.QuotedIdentifierCase
    AdbGenericDataSourceInformationService.QuotedIdentifierPattern
    AdbGenericDataSourceInformationService.StatementSeparatorPattern
    AdbGenericDataSourceInformationService.StringLiteralPattern
    AdbGenericDataSourceInformationService.SupportedJoinOperators
    AdbGenericDataSourceInformationService.ToString()
    Namespace: actionETL.Adb.SqlClientExternal
    Assembly: actionETL.dll
    Syntax
    public class AdbSqlClientDataSourceInformationService : AdbGenericDataSourceInformationService, IAdbDataSourceInformationService

    Constructors

    AdbSqlClientDataSourceInformationService(IAdbConnection, Boolean)

    Initializes a new instance of the AdbSqlClientDataSourceInformationService class, which provides information about a SQL Server® data source behind a connection, such as what character to use for quoting, how to specify parameter markers etc. This supports writing provider-independent database code, and is used by both the SqlClient provider and the ODBC for SQL Server provider.

    Declaration
    protected AdbSqlClientDataSourceInformationService(IAdbConnection adbConnection, bool ansiQuotes)
    Parameters
    Type Name Description
    IAdbConnection adbConnection

    An Adb database connection.

    Boolean ansiQuotes

    Set to false to quote identifiers with the default square brackets, i.e. with IdentifierQuotePrefix set to [, and IdentifierQuoteSuffix set to ].

    Set to true to use ANSI double quotes to quote identifiers, i.e. with IdentifierQuotePrefix and IdentifierQuoteSuffix set to ". This is used with SET QUOTED_IDENTIFIER ON. Also see SET QUOTED_IDENTIFIER (Transact-SQL).

    Exceptions
    Type Condition
    ArgumentNullException

    adbConnection

    ConfigurationErrorsException

    There are two entries with the same name in the localdbinstances section.

    InvalidOperationException
    • Cannot open a connection without specifying a data source or server.
    • May throw if the connection is associated with a transaction.
    SqlException
    • A connection-level error occurred while opening the connection. If the Number property contains the value 18487 or 18488, this indicates that the specified password has expired or must be reset. See the ChangePassword method for more information.
    • The system.data.localdb tag in the app.config file has invalid or unknown elements.

    See SqlException for further details.

    Methods

    Get()

    Gets a function that returns a new instance of AdbSqlClientDataSourceInformationService (with default settings) on each invocation, which is used when instantiating a new AdbProvider for accessing a SQL Server® data source.

    The instance uses the default square brackets to quote and parse identifiers, i.e. with IdentifierQuotePrefix set to [, and IdentifierQuoteSuffix set to ], and uses named parameters. Also see Get(Boolean) and SET QUOTED_IDENTIFIER (Transact-SQL).

    Declaration
    public static Func<IAdbConnection, IAdbDataSourceInformationService> Get()
    Returns
    Type Description
    Func<IAdbConnection, IAdbDataSourceInformationService>

    Get(Boolean)

    Gets a function that returns a new instance of AdbSqlClientDataSourceInformationService on each invocation, which is used when instantiating a new AdbProvider for accessing a SQL Server® data source, either via the SqlClient provider or via the ODBC provider. Also see Get().

    Declaration
    public static Func<IAdbConnection, IAdbDataSourceInformationService> Get(bool ansiQuotes)
    Parameters
    Type Name Description
    Boolean ansiQuotes

    Set to false to quote identifiers with the default square brackets, i.e. with IdentifierQuotePrefix set to [, and IdentifierQuoteSuffix set to ].

    Set to true to use ANSI double quotes to quote identifiers, i.e. with IdentifierQuotePrefix and IdentifierQuoteSuffix set to ". This is used with SET QUOTED_IDENTIFIER ON. Also see SET QUOTED_IDENTIFIER (Transact-SQL).

    Returns
    Type Description
    Func<IAdbConnection, IAdbDataSourceInformationService>

    Implements

    IAdbDataSourceInformationService

    See Also

    AdbGenericDataSourceInformationService
    Information
    AdbSqlClientProvider
    In This Article
    Back to top Copyright © 2023 Envobi Ltd