Class IgniteDbCommand
Ignite database command.
public sealed class IgniteDbCommand : DbCommand, IComponent, IDbCommand, IDisposable, IAsyncDisposable
- Inheritance
-
IgniteDbCommand
- Implements
- Inherited Members
Properties
CommandText
Gets or sets the text command to run against the data source.
public override string CommandText { get; set; }
Property Value
- string
The text command to execute. The default value is an empty string ("").
CommandTimeout
Gets or sets the wait time (in seconds) before terminating the attempt to execute the command and generating an error.
public override int CommandTimeout { get; set; }
Property Value
- int
The time in seconds to wait for the command to execute.
CommandType
Gets or sets how the CommandText property is interpreted.
public override CommandType CommandType { get; set; }
Property Value
- CommandType
One of the enumeration values that specifies how a command string is interpreted. The default is
Text.
DbConnection
Gets or sets the DbConnection used by this DbCommand.
protected override DbConnection? DbConnection { get; set; }
Property Value
- DbConnection
The connection to the data source.
DbParameterCollection
Gets the collection of DbParameter objects.
protected override DbParameterCollection DbParameterCollection { get; }
Property Value
- DbParameterCollection
The parameters of the SQL statement or stored procedure.
DbTransaction
Gets or sets the DbTransaction within which this DbCommand object executes.
protected override DbTransaction? DbTransaction { get; set; }
Property Value
- DbTransaction
The transaction within which a command object of a .NET data provider executes. The default value is a null reference (
Nothingin Visual Basic).
DesignTimeVisible
Gets or sets a value indicating whether the command object should be visible in a customized interface control.
public override bool DesignTimeVisible { get; set; }
Property Value
- bool
true, if the command object should be visible in a control; otherwise false. The default is true.
IgniteDbTransaction
Gets or sets the transaction within which the command executes.
public IgniteDbTransaction? IgniteDbTransaction { get; set; }
Property Value
PageSize
Gets or sets the page size (number of rows fetched at a time by the underlying Ignite data reader).
public int PageSize { get; set; }
Property Value
UpdatedRowSource
Gets or sets how command results are applied to the DataRow when used by the Update method of a DbDataAdapter.
public override UpdateRowSource UpdatedRowSource { get; set; }
Property Value
- UpdateRowSource
One of the enumeration values that indicates how command results are applied. The default is
Bothunless the command is automatically generated. Then the default isNone.
Methods
Cancel()
Attempts to cancel the execution of a DbCommand.
public override void Cancel()
CreateDbParameter()
Creates a new instance of a DbParameter object.
protected override DbParameter CreateDbParameter()
Returns
- DbParameter
A DbParameter object.
Dispose(bool)
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
protected override void Dispose(bool disposing)
Parameters
disposingbooltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
ExecuteDbDataReader(CommandBehavior)
Executes the command against its connection, returning a DbDataReader which can be used to access the results.
protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior)
Parameters
behaviorCommandBehaviorAn instance of CommandBehavior, specifying options for command execution and data retrieval.
Returns
- DbDataReader
A DbDataReader object.
Exceptions
- DbException
An error occurred while executing the command.
- ArgumentException
An invalid CommandBehavior value.
ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken)
Providers should implement this method to provide a non-default implementation for System.Data.Common.DbCommand.ExecuteReader* overloads.
The default implementation invokes the synchronous ExecuteReader() method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by ExecuteReader will be communicated via the returned Task Exception property.
This method accepts a cancellation token that can be used to request the operation to be cancelled early. Implementations may ignore this request.
protected override Task<DbDataReader> ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
Parameters
behaviorCommandBehaviorAn instance of CommandBehavior, specifying options for command execution and data retrieval.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<DbDataReader>
A task representing the asynchronous operation.
Exceptions
- DbException
An error occurred while executing the command.
- ArgumentException
An invalid CommandBehavior value.
ExecuteNonQuery()
Executes the command against its connection object, returning the number of rows affected.
public override int ExecuteNonQuery()
Returns
- int
The number of rows affected.
ExecuteNonQueryAsync(CancellationToken)
This is the asynchronous version of ExecuteNonQuery(). Providers should override with an appropriate implementation. The cancellation token may optionally be ignored.
The default implementation invokes the synchronous ExecuteNonQuery() method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by ExecuteNonQuery() will be communicated via the returned Task Exception property.
Do not invoke other methods and properties of the DbCommand object until the returned Task is complete.
public override Task<int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
Exceptions
- DbException
An error occurred while executing the command.
ExecuteScalar()
Executes the command and returns the first column of the first row in the first returned result set. All other columns, rows and result sets are ignored.
public override object? ExecuteScalar()
Returns
- object
The first column of the first row in the first result set.
ExecuteScalarAsync(CancellationToken)
This is the asynchronous version of ExecuteScalar(). Providers should override with an appropriate implementation. The cancellation token may optionally be ignored.
The default implementation invokes the synchronous ExecuteScalar() method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by ExecuteScalar will be communicated via the returned Task Exception property.
Do not invoke other methods and properties of the DbCommand object until the returned Task is complete.
public override Task<object?> ExecuteScalarAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
Exceptions
- DbException
An error occurred while executing the command.
Prepare()
Creates a prepared (or compiled) version of the command on the data source.
public override void Prepare()
ToString()
Returns a string containing the name of the Component, if any. This method should not be overridden.
public override string ToString()