Show / Hide Table of Contents

Class SoCommand

Implements the IDbCommand.

Inheritance
Object
SoCommand
Implements
IDbCommand
IDisposable
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.Data
Assembly: SoDataBase.dll
Syntax
public sealed class SoCommand : IDbCommand, IDisposable

Properties

Connection

Connection to be used for execution of this command

Declaration
public SoConnection Connection { get; set; }
Property Value
Type Description
SoConnection

IsAutoSentry

Does this command use the AutoSentry system, where sentries are automatically created based on an analysis of the command

Declaration
public bool IsAutoSentry { get; set; }
Property Value
Type Description
Boolean

IsDefaultTransaction

Flag indicating whether the Transaction property is an internally-generated default transaction. If false, then the transaction was created by the calling code and is that code's responsibility.

Declaration
public bool IsDefaultTransaction { get; }
Property Value
Type Description
Boolean

Sentries

Collection of Sentries relevant to the execution of this command

Declaration
public SentryCollection Sentries { get; }
Property Value
Type Description
SentryCollection

SqlCommand

The sql command to be processed

Declaration
public SqlCommand SqlCommand { get; set; }
Property Value
Type Description
SqlCommand

Transaction

Transaction that this command will be a member of

Declaration
public SoTransaction Transaction { get; set; }
Property Value
Type Description
SoTransaction

UpdatedRowSource

Declaration
public UpdateRowSource UpdatedRowSource { get; set; }
Property Value
Type Description
UpdateRowSource

Methods

Cancel()

Attempts to cancels the execution of an IDbCommand.

Declaration
public void Cancel()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

ExecuteNonQuery()

Executes an SQL statement against the Connection object of a .NET Framework data provider, and returns the number of rows affected.

Declaration
public int ExecuteNonQuery()
Returns
Type Description
Int32

The number of rows affected.

Exceptions
Type Condition
InvalidOperationException

The connection does not exist.-or- The connection is not open.

ExecutePassThrough(String)

Declaration
public void ExecutePassThrough(string nonQuerySql)
Parameters
Type Name Description
String nonQuerySql

ExecuteReader()

Execute the on the Connection, create an SoDataReader to read the results, and return it. The reader will start on row 1 and go through the whole result set.

Declaration
public SoDataReader ExecuteReader()
Returns
Type Description
SoDataReader

SoDataReader, which implements the IDataReader interface as well as SuperOffice functionality

ExecuteReader(CommandBehavior)

Execute the on the Connection, create an SoDataReader to read the results, and return it. The reader will start on row 1 and go through the whole result set.

Declaration
public SoDataReader ExecuteReader(CommandBehavior behaviour)
Parameters
Type Name Description
CommandBehavior behaviour

Command behaviour, passed through to the underlying ADO.NET provider

Returns
Type Description
SoDataReader

SoDataReader, which implements the IDataReader interface as well as SuperOffice functionality

ExecuteReader(CommandBehavior, Int32, Int32)

Execute the on the Connection, create an SoDataReader to read the results, and return it. The reader will return one page of records, as defined by the page size and starting point.

Declaration
public SoDataReader ExecuteReader(CommandBehavior behaviour, int pageSize, int pageWanted)
Parameters
Type Name Description
CommandBehavior behaviour

Command behaviour, passed through to the underlying ADO.NET provider

Int32 pageSize

Number of records per page; only one page will be returned by the reader

Int32 pageWanted

Desired page, starting at 0.

Returns
Type Description
SoDataReader

SoDataReader, which implements the IDataReader interface as well as SuperOffice functionality

ExecuteReader(Int32, Int32)

Execute the on the Connection, create an SoDataReader to read the results, and return it. The reader will return one page of records, as defined by the page size and starting point.

Declaration
public SoDataReader ExecuteReader(int pageSize, int pageWanted)
Parameters
Type Name Description
Int32 pageSize

Number of records per page; only one page will be returned by the reader

Int32 pageWanted

Desired page, starting at 0.

Returns
Type Description
SoDataReader

SoDataReader, which implements the IDataReader interface as well as SuperOffice functionality

ExecuteScalar()

Executes the query, and returns the first column of the first row in the resultset returned by the query. Extra columns or rows are ignored.

Declaration
public object ExecuteScalar()
Returns
Type Description
Object

The first column of the first row in the resultset.

LogNonQuery(TimeSpan, Int32, String)

Declaration
public void LogNonQuery(TimeSpan executionTime, int rowsAffected, string exceptionMessage)
Parameters
Type Name Description
TimeSpan executionTime
Int32 rowsAffected
String exceptionMessage

LogQueryReader(TimeSpan, Int32, String)

Declaration
public void LogQueryReader(TimeSpan executionTime, int rowsAffected, string exceptionMessage)
Parameters
Type Name Description
TimeSpan executionTime
Int32 rowsAffected
String exceptionMessage

LogQueryScalar(TimeSpan, Int32, String)

Declaration
public void LogQueryScalar(TimeSpan executionTime, int rowsAffected, string exceptionMessage)
Parameters
Type Name Description
TimeSpan executionTime
Int32 rowsAffected
String exceptionMessage

Prepare()

Creates a prepared (or compiled) version of the command on the data source.

Declaration
public void Prepare()
Exceptions
Type Condition
InvalidOperationException

The Connection is not set.-or- The Connection is not .

Implements

System.Data.IDbCommand
System.IDisposable

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top