Click or drag to resize
GeneralConnection Class
Represents a general database connection.
Inheritance Hierarchy
SystemObject
  CMS.DataEngineGeneralConnection

Namespace: CMS.DataEngine
Assembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 13.0.131
Syntax
C#
[SerializableAttribute]
public class GeneralConnection : ISerializable, 
	IDataConnection, IDisposable

The GeneralConnection type exposes the following members.

Constructors
  NameDescription
Protected methodGeneralConnection(String)
Constructor.
Public methodGeneralConnection(SerializationInfo, StreamingContext)
Constructor for deserialization.
Top
Properties
  NameDescription
Public propertyCommandTimeout
Command timeout.
Public propertyConnectionString
Connection string for specific provider.
Public propertyDataConnection
Data connection for specific provider.
Public propertyDisableConnectionDebug
If true, the debug is disabled on this connection
Public propertyDisableQueryDebug
If true, the debug of the executed queries is disabled on this connection
Public propertyKeepOpen
If true, the connection stays open even if close is requested.
Public propertyUseScopeConnection
If true, the connection uses the scope connection
Top
Methods
  NameDescription
Public methodBulkInsert
Performs a bulk insert of the data into a target database table
Public methodClose
Closes the connection.
Public methodDispose
Disposes the connection
Public methodExecuteNonQuery
Executes the query and returns the number of rows affected.
Public methodExecuteNonQueryAsync

An asynchronous version of ExecuteNonQuery(QueryParameters) 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(QueryParameters)
Executes query and returns result as a DataSet.
Public methodExecuteQuery(QueryParameters, Int32)
Executes query and returns result as a DataSet. Returns the total number of result items.
Public methodExecuteReader
Executes the query and returns result of the query as a DbDataReader.
Public methodExecuteReaderAsync

An asynchronous version of ExecuteReader(QueryParameters, 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.

Protected methodExecuteReaderCore
Executes the query and returns result of the query as a DbDataReader.
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(QueryParameters), 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 methodGetObjectData
Gets object data.
Public methodIsOpen
Returns true if the connection is open.
Public methodLogQueryEnd
Logs the end of the query processing.
Public methodLogQueryStart
Logs query start. Logs the query to the file and to current request log for debugging.
Public methodOpen
Opens the connection.
Protected methodRunQuery
Runs the query against SQL DB.
Top
See Also