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.
Implements
Inherited Members
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
Set to |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ConfigurationErrorsException | There are two entries with the same name in the |
| InvalidOperationException |
|
| SqlException |
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
Set to |
Returns
| Type | Description |
|---|---|
| Func<IAdbConnection, IAdbDataSourceInformationService> |