Icon EDBCommand Class

The EDBCommand class implements the DbCommand abstract class, providing an encapsulation of an ElevateDB table, stored procedure, SQL statement, or script.

Namespace: Elevate.ElevateDB.Data

Inherits From System.Data.Common.DbCommand

Implements ICloneable

Constructors

(<No Parameters>)
(CommandText: String)
(CommandText: String; Connection: EDBConnection)
(CommandText: String; Connection: EDBConnection; Transaction: EDBTransaction)

Properties
PropertyDescription
CommandTextType: EDBCommandTextTypeIndicates the type of command specified in the CommandText property when the CommandType property is set to Text.
EngineVersion: StringIndicates the current version of ElevateDB being used. This property is read-only.
ExecutionResult: BooleanThe ExecutionResult property indicates the result of the execution of the current command. Currently, this only applies to the VERIFY TABLE and REPAIR TABLE SQL statements. This property will be True if any errors were found, and False if no errors were found.
ExecutionTime: DoubleIndicates the total time, in seconds, that the current command took to execute when the CommandType property is set to Text. This time does not include any time taken to prepare the command, if required, only the execution time itself.
IsPrepared: BooleanIndicates whether the current command text has been prepared or not.
IsOpened: BooleanIndicates whether there is an active data reader present for the current command.
ParamCheck: BooleanSpecifies whether or not the Parameters property is cleared and regenerated if the CommandText property is modified. By default the ParamCheck property is False, meaning that the Parameters property is not automatically generated. When ParamCheck is True, the proper number of parameters is guaranteed to be generated for the current command.
Plan: StringIndicates the query plan for the current SQL statement specified in the CommandText property once the statement is executed and the RequestPlan property is set to True. The Plan property is cleared before each new statement execution.
RequestPlan: BooleanSpecifies that a query plan be generated and stored in the Plan property when the SQL statement specified in the CommandText property is executed. The default is False.

Information Query plans are only generated for SQL SELECT, INSERT, UPDATE, or DELETE statements.
RequestSensitive: BooleanSpecifies whether or not ElevateDB should attempt to return a sensitive result set when the current SELECT statement in the CommandText property is excuted. The RequestSensitive property is False by default, meaning that an insensitive and read-only result set will be returned.

Information Setting RequestSensitive to True does not guarantee that a sensitive result set will be returned by ElevateDB. A sensitive result set will be returned only if the SELECT statement syntax conforms to the syntax requirements for a sensitive result set. If the RequestSensitive property is True, but the syntax does not conform to the requirements, ElevateDB returns an insensitive result set. After executing the query, inspect the Sensitive property to determine whether the request for a sensitive result set was successful.
RowReadSize: Int32Use this property to specify how many rows should be read from an ElevateDB Server at one time when any result set for the command is navigated. This property is useful for specifying the row read size when you cannot get access to the EDBDataReader instance used for navigating the result set, which is the case when using an EDBDataAdapter instance.

Information Any time an EDBDataReader or EDBDataCursor instance is created using the ExecuteReader or ExecuteCursor (ElevateDB-specific) methods, the RowReadSize property of the instance will be initialized with the value specified by the EDBCommand.RowReadSize property.
RowsAffected: Int32Indicates how many rows were selected, inserted, updated or deleted by the execution of the current SQL statement specified via the CommandText property. If RowsAffected is 0, the SQL statement did not select, insert, update or delete any rows.

Information This property is only useful for SELECT, INSERT, UPDATE, or DELETE statements.
Sensitive: BooleanIndicates whether the current SELECT statement returned a sensitive result set.

Methods
MethodDescription
ExecuteCursor: EDBDataCursorExecutes the current command, and returns an instance of the EDBDataCursor class that can be used as a bi-directional cursor on the result set generated by the command.
CloseCloses the current command, freeing any result set that may be active from the last execution of the command.
LoadFromFile(const FileName: String)Loads a command from a text file into the CommandText property of the current command.

Events
EventDescription
OnProgress: EDBProgressEventSetting this event adds an event handler to the list of event handlers listening for the OnProgress event during the current command execution. The arguments for the event handler are defined in the EDBProgressEventArgs class. The OnProgress event is used to retrieve the progress of the currently-executing command and, optionally, to cancel the execution of the command.
OnStatusMessage: EDBStatusMessageEventSetting this event adds an event handler to the list of event handlers listening for the OnStatusMessage event during the current command execution. The arguments for the event handler are defined in the EDBMessageEventArgs class. The OnStatus event is used to retrieve the status of the currently-executing command.
OnLogMessage: EDBLogMessageEventSetting this event adds an event handler to the list of event handlers listening for the OnLogMessage event during the current command execution. The arguments for the event handler are defined in the EDBMessageEventArgs class. The OnLogMessage event is used to retrieve any log messages for the currently-executing command. Log messages are generated during various administrative and DDL statements.
Image