C# Class MonoSoftware.MonoX.DAL.DatabaseSpecific.DataAccessAdapter

Data access adapter class, which controls the complete database interaction with the database for all objects.
Use a DataAccessAdapter object solely per thread, and per connection. A DataAccessAdapter object contains 1 active connection and no thread-access scheduling code. This means that you need to create a new DataAccessAdapter object if you want to utilize in another thread a new connection and a new transaction or want to open a new connection.
Inheritance: DataAccessAdapterBase
Afficher le fichier Open project: MonoSoftware/MonoX-Data-Access-Layer Class Usage Examples

Méthodes publiques

Свойство Type Description
ConnectionStringKeyName string

Méthodes publiques

Méthode Description
DataAccessAdapter ( ) : System

CTor

DataAccessAdapter ( bool keepConnectionOpen ) : System

CTor

DataAccessAdapter ( string connectionString ) : System

CTor

DataAccessAdapter ( string connectionString, bool keepConnectionOpen ) : System

CTor

DataAccessAdapter ( string connectionString, bool keepConnectionOpen, CatalogNameOverwriteHashtable catalogNameOverwrites, SchemaNameOverwriteHashtable schemaNameOverwrites ) : System

CTor.

DataAccessAdapter ( string connectionString, bool keepConnectionOpen, CatalogNameUsage catalogNameUsageSetting, string catalogNameToUse ) : System

CTor.

For backwards compatibility.

DataAccessAdapter ( string connectionString, bool keepConnectionOpen, SchemaNameUsage schemaNameUsageSetting, string schemaNameToUse ) : System

CTor

SetArithAbortFlag ( bool value ) : void

Sets the flag to signal the SqlServer DQE to generate SET ARITHABORT ON statements prior to INSERT, DELETE and UPDATE Queries. Keep this flag to false in normal usage, but set it to true if you need to write into a table which is part of an indexed view. It will not affect normal inserts/updates that much, leaving it on is not harmful. See Books online for details on SET ARITHABORT ON. After each statement the setting is turned off if it has been turned on prior to that statement.

Setting this flag is a global change.

SetSqlServerCompatibilityLevel ( SqlServerCompatibilityLevel compatibilityLevel ) : void

Sets the default compatibility level used by the DQE. Default is SqlServer2005. This is a global setting. Compatibility level influences the query generated for paging, sequence name (@@IDENTITY/SCOPE_IDENTITY()), and usage of newsequenceid() in inserts. It also influences the ado.net provider to use. This way you can switch between SqlServer server client 'SqlClient' and SqlServer CE Desktop.

Setting this property will overrule a similar setting in the .config file. Don't set this property when queries are executed as it might switch factories for ADO.NET elements which could result in undefined behavior so set this property at startup of your application

Méthodes protégées

Méthode Description
CreateDynamicQueryEngine ( ) : DynamicQueryEngineBase

Creates a new Dynamic Query engine object and passes in the defined catalog/schema overwrite hashtables.

SetPerInstanceCompatibilityLevel ( DynamicQueryEngineBase dqe ) : void

Sets the per instance compatibility level on the dqe instance specified.

Private Methods

Méthode Description
ReadConnectionStringFromConfig ( ) : string

Reads the value of the setting with the key ConnectionStringKeyName from the *.config file and stores that value as the active connection string to use for this object.

Method Details

CreateDynamicQueryEngine() protected méthode

Creates a new Dynamic Query engine object and passes in the defined catalog/schema overwrite hashtables.
protected CreateDynamicQueryEngine ( ) : DynamicQueryEngineBase
Résultat DynamicQueryEngineBase

DataAccessAdapter() public méthode

CTor
public DataAccessAdapter ( ) : System
Résultat System

DataAccessAdapter() public méthode

CTor
public DataAccessAdapter ( bool keepConnectionOpen ) : System
keepConnectionOpen bool when true, the DataAccessAdapter will not close an opened connection. Use this for multi action usage.
Résultat System

DataAccessAdapter() public méthode

CTor
public DataAccessAdapter ( string connectionString ) : System
connectionString string The connection string to use when connecting to the database.
Résultat System

DataAccessAdapter() public méthode

CTor
public DataAccessAdapter ( string connectionString, bool keepConnectionOpen ) : System
connectionString string The connection string to use when connecting to the database.
keepConnectionOpen bool when true, the DataAccessAdapter will not close an opened connection. Use this for multi action usage.
Résultat System

DataAccessAdapter() public méthode

CTor.
public DataAccessAdapter ( string connectionString, bool keepConnectionOpen, CatalogNameOverwriteHashtable catalogNameOverwrites, SchemaNameOverwriteHashtable schemaNameOverwrites ) : System
connectionString string The connection string to use when connecting to the database.
keepConnectionOpen bool when true, the DataAccessAdapter will not close an opened connection. Use this for multi action usage.
catalogNameOverwrites CatalogNameOverwriteHashtable The from-to name value pairs and setting for the overwriting of catalog names. Can be null.
schemaNameOverwrites SchemaNameOverwriteHashtable The from-to name value pairs and setting for the overwriting of schema names. Can be null.
Résultat System

DataAccessAdapter() public méthode

CTor.
For backwards compatibility.
public DataAccessAdapter ( string connectionString, bool keepConnectionOpen, CatalogNameUsage catalogNameUsageSetting, string catalogNameToUse ) : System
connectionString string The connection string to use when connecting to the database.
keepConnectionOpen bool when true, the DataAccessAdapter will not close an opened connection. Use this for multi action usage.
catalogNameUsageSetting CatalogNameUsage Configures this data access adapter object how to threat catalog names in persistence information.
catalogNameToUse string The name to use if catalogNameUsageSetting is set to ForceName. Ignored otherwise.
Résultat System

DataAccessAdapter() public méthode

CTor
public DataAccessAdapter ( string connectionString, bool keepConnectionOpen, SchemaNameUsage schemaNameUsageSetting, string schemaNameToUse ) : System
connectionString string The connection string to use when connecting to the database.
keepConnectionOpen bool when true, the DataAccessAdapter will not close an opened connection. Use this for multi action usage.
schemaNameUsageSetting SchemaNameUsage Configures this data access adapter object how to threat schema names in persistence information.
schemaNameToUse string Oracle specific. The name to use if schemaNameUsageSetting is set to ForceName. Ignored otherwise.
Résultat System

SetArithAbortFlag() public static méthode

Sets the flag to signal the SqlServer DQE to generate SET ARITHABORT ON statements prior to INSERT, DELETE and UPDATE Queries. Keep this flag to false in normal usage, but set it to true if you need to write into a table which is part of an indexed view. It will not affect normal inserts/updates that much, leaving it on is not harmful. See Books online for details on SET ARITHABORT ON. After each statement the setting is turned off if it has been turned on prior to that statement.
Setting this flag is a global change.
public static SetArithAbortFlag ( bool value ) : void
value bool
Résultat void

SetPerInstanceCompatibilityLevel() protected méthode

Sets the per instance compatibility level on the dqe instance specified.
protected SetPerInstanceCompatibilityLevel ( DynamicQueryEngineBase dqe ) : void
dqe DynamicQueryEngineBase The dqe.
Résultat void

SetSqlServerCompatibilityLevel() public static méthode

Sets the default compatibility level used by the DQE. Default is SqlServer2005. This is a global setting. Compatibility level influences the query generated for paging, sequence name (@@IDENTITY/SCOPE_IDENTITY()), and usage of newsequenceid() in inserts. It also influences the ado.net provider to use. This way you can switch between SqlServer server client 'SqlClient' and SqlServer CE Desktop.
Setting this property will overrule a similar setting in the .config file. Don't set this property when queries are executed as it might switch factories for ADO.NET elements which could result in undefined behavior so set this property at startup of your application
public static SetSqlServerCompatibilityLevel ( SqlServerCompatibilityLevel compatibilityLevel ) : void
compatibilityLevel SqlServerCompatibilityLevel
Résultat void

Property Details

ConnectionStringKeyName public_oe static_oe property

The name of the key in the *.config file of the executing application which contains the connection string.
Default: the value set in the LLBLGen Pro project properties
public static string ConnectionStringKeyName
Résultat string