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

Namespace: CMS.DataProviderSQL
Assembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 13.0.131
Syntax
C#
public class DataConnection : AbstractDataConnection

The DataConnection type exposes the following members.

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

(Inherited from AbstractDataConnection.)
Public methodExecuteQuery
Returns result of the query.
(Inherited from AbstractDataConnection.)
Public methodExecuteReader
Executes the query and returns result of the query as a DbDataReader.
(Inherited from AbstractDataConnection.)
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.

(Inherited from AbstractDataConnection.)
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.
(Inherited from AbstractDataConnection.)
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.

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