Click or drag to resize
AbstractDataConnection Class
Represents SQL Server data connection.
Inheritance Hierarchy
SystemObject
  CMS.DataEngineAbstractDataConnection
    CMS.DataProviderSQLDataConnection

Namespace: CMS.DataEngine
Assembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 13.0.131
Syntax
C#
public abstract class AbstractDataConnection : IDataConnection, 
	IDisposable, INotCopyThreadItem

The AbstractDataConnection type exposes the following members.

Constructors
  NameDescription
Protected methodAbstractDataConnection
Constructor.
Top
Fields
  NameDescription
Protected fieldmCommandTimeout
Command timeout.
Protected fieldmConnectionString
Connection string for specific provider.
Protected fieldmConnectionStringName
Connection string name
Protected fieldmLastError
Last connection error
Protected fieldmNativeConnection
Native connection object. It depends on provider type.
Protected fieldmNestedConnections
Nested connections indexed by the connection string [connectionString -> IDbConnection]
Protected fieldmNestedConnectionsList
List of nested connections
Protected fieldmNestedOpenConnections
List of nested connections that were automatically opened
Protected fieldmNestedOpenTransactions
List of nested connections that were automatically opened with transaction
Protected fieldmUseScopeConnection
If true, the connection uses the scope connection
Top
Properties
  NameDescription
Public propertyCommandTimeout
Command timeout.
Public propertyConnectionString
Connection string for specific provider.
Public propertyDisableConnectionDebug
If true, the debug is disabled on this connection
Public propertyDisableQueryDebug
If true, the debug of queries is disabled on this connection
Public propertyKeepOpen
If true, the connection stays open even if close is requested.
Protected propertyLocalKeepOpen
If true, the connection stays open even if close is requested.
Protected propertyLocalTransaction
Transaction object of local instance.
Public propertyNativeConnection
Native connection object. It depends on provider type.
Protected propertyNativeDBConnection
Native connection object. It depends on provider type.
Public propertyTransaction
Transaction object.
Public propertyUseScopeConnection
If true, the connection uses the scope connection
Top
Methods
  NameDescription
Protected methodAddParameters
Adds the given parameters to the SQL command
Public methodBeginTransaction
Begins a new transaction.
Public methodBeginTransaction(IsolationLevel)
Begins a new transaction.
Public methodBulkInsert
Performs a bulk insert of the data into a target database table
Protected methodCheckThreadSafety
Checks the thread safety of current operation.
Public methodClose
Closes connection to the database.
Public methodCommitTransaction
Commits current transaction.
Protected methodCreateCommand
Creates a new SQL command
Protected methodCreateDataAdapter
Creates a data adapter
Protected methodCreateNativeConnection
Creates a new native connection
Protected methodCreateParameter(DataParameter)
Creates a SQL parameter from the given data parameter
Protected methodCreateParameter(String, Object)
Creates a new command parameter
Public methodDispose
Disposes the connection object.
Public methodExecuteNonQuery
Executes the query and returns the number of rows affected.
Public methodExecuteNonQueryAsync

An asynchronous version of ExecuteNonQuery(String, QueryDataParameters, QueryTypeEnum, Boolean) which executes the query asynchronously and returns the number of rows affected.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

Public methodExecuteQuery
Returns result of the query.
Public methodExecuteReader
Executes the query and returns result of the query as a DbDataReader.
Public methodExecuteReaderAsync

An asynchronous version of ExecuteReader(String, QueryDataParameters, QueryTypeEnum, CommandBehavior) which executes the query asynchronously and returns result as a DbDataReader.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

Public methodExecuteScalar
Executes the query and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Public methodExecuteScalarAsync

An asynchronous version of ExecuteScalar(String, QueryDataParameters, QueryTypeEnum, Boolean), which executes the query asynchronously and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

Public methodGetExecutingConnection
Gets the connection that executes the given query
Public methodGetNestedConnection
Gets the nested connection with the given connection string
Public methodGetXmlSchema
Returns XML schema for specified table.
Protected methodHandleDbError
Handles the database error. Returns false, if the error was not handled
Protected methodHandleError
Handles the error. Returns false, if the error was not handled
Public methodIsOpen
Returns true if connection to the database is open.
Public methodIsTransaction
Indicates if transaction is running.
Protected methodLoadDefaultConnectionString
Loads the default connection string
Public methodLogConnectionOperation
Logs the connection operation to the query log.
Public methodNativeConnectionExists
Returns true if the native connection exists.
Public methodNativeDBConnectionExists
Returns true if the native connection exists.
Public methodOpen
Opens connection to the database.
Protected methodPrepareCommand
Prepares the SQL command for the query.
Protected methodProcessOutParameters
Ensures propagation of output (or inputoutput) parameters after the SQL command execution to the query parameters collection.
Public methodRollbackTransaction
Rollbacks current transaction.
Protected methodSetParameterType
Sets the parameter type to a destination type
Protected methodValidateTransaction
Validates the transaction
Top
See Also