Icon EDBConnection Class

The EDBConnection class implements the DbConnection abstract class, providing an encapsulation of an ElevateDB local or remote session connected to a given ElevateDB database. A session acts like a "virtual user" and each new EDBConnection instance used in an application maintains its own database connections, table buffers, table/view/query result set cursors, etc. Because of the unique requirements of a multi-threaded application, ElevateDB requires that you use a separate EDBConnection component for each thread in use, thus treating each thread as a separate "virtual user".

Namespace: Elevate.ElevateDB.Data

Inherits From System.Data.Common.DbConnection

Implements ICloneable

Constructors

(<No Parameters>)
(ConnectString: String)

Properties
PropertyDescription
EngineVersion: StringIndicates the current version of ElevateDB being used. This property is read-only.
InTransaction: BooleanUse the InTransaction property at run-time to determine if a transaction is currently in progress for the current connection. The InTransaction property is True if a transaction is in progress and False if a transaction is not in progress.

The value of the InTransaction property cannot be changed directly. Calling the EDBConnection BeginTransaction method sets the InTransaction property to True. Calling the EDBTransaction Commit or EDBTransaction Rollback methods sets the InTransaction property to False.
ReadOnly: BooleanIndicates whether the current connection is using read-only access only.

Methods
MethodDescription
Clone: System.ObjectClones the current connection, including current contents of the ConnectionString property.
BeginTransaction(array of String): DbTransactionStarts a restricted transaction for the current connection. Please see the Transactions topic for more information on restricted transactions.

Events
EventDescription
OnLogin: EDBLoginEventSetting this event adds an event handler to the list of event handlers listening for the OnLogin event when the connection is first opened. The arguments for the event handler are defined in the EDBLoginEventArgs class. The OnLogin event is used to augment the login process and programmtically supply the user name and password used with the login. It can also be used to display a custom interactive login dialog whenever a connection is first opened.

Information The OnLogin event is only triggered when either the user name (UID attribute) or password (PWD attribute) are missing from the connection string used with the connection. Please see the Connection Strings topic for more information on the UID and PWD connection string attributes.
OnTimeout: EDBTimeoutEventSetting this event adds an event handler to the list of event handlers listening for the OnTimeout event while the current connection is connected to an ElevateDB Server. The arguments for the event handler are defined in the EDBTimeoutEventArgs class. The OnTimeout event is used to deal with situations where the connection is waiting on a response from an ElevateDB Server, and the wait time has exceeded the timeout (TIMEOUT attribute) defined for the connection in the connection string. Setting the StayConnected property of the event arguments to False will cause the connection to disconnect from the ElevateDB Server, whereas leaving the StayConnected property of the event arguments to True will keep the connection connected to the ElevateDB Server. Please see the Connection Strings topic for more information on the TIMEOUT connection string attribute.
OnReconnect: EDBReconnectEventSetting this event adds an event handler to the list of event handlers listening for the OnReconnect event while the current connection is connected to an ElevateDB Server. The arguments for the event handler are defined in the EDBReconnectEventArgs class. The OnReconnect event is called whenever the connection needs to be re-established automatically due to a drop in the connection or a timeout (see OnTimeout event above). This event usually only occurs when the connection was not configured to ping the ElevateDB Server at regular intervals in the connection string (PING attribute set to False). In such a case, the ElevateDB Server may timeout the connection and disconnect it (but not remove it), resulting in the OnReconnect event being triggered the next time the connection tries to send a request to the ElevateDB Server. Please see the Connection Strings topic for more information on the PING connection string attribute.
OnSendProgress: EDBCommsProgressEventSetting this event adds an event handler to the list of event handlers listening for the OnSendProgress event while the current connection is connected to an ElevateDB Server. The arguments for the event handler are defined in the EDBCommsProgressEventArgs class. The OnSendProgress event is called whenever the connection needs to send a request to an ElevateDB Server, and may be called multiple times for a single request, depending upon the size of the request.
OnReceiveProgress: EDBCommsProgressEventSetting this event adds an event handler to the list of event handlers listening for the OnReceiveProgress event while the current connection is connected to an ElevateDB Server. The arguments for the event handler are defined in the EDBCommsProgressEventArgs class. The OnReceiveProgress event is called whenever the connection receives a response to a request from an ElevateDB Server, and may be called multiple times for a single response, depending upon the size of the response.
OnTrace: EDBTraceEventSetting this event adds an event handler to the list of event handlers listening for the OnTrace event while the current connection is connected to an ElevateDB Server. The arguments for the event handler are defined in the EDBTraceEventArgs class. The OnTrace event is called whenever the connection sends a request to an ElevateDB Server or receives a response to a request from an ElevateDB Server. It is useful for tracing the activity for a connection to help determine performance bottlenecks, especially over WANs (wide-area networks) like the Internet.
Image