Table of Contents

Method CreateTextCommand

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

CreateTextCommand(IDbTransaction, string, int)

Creates a text IDbCommand on the transaction's connection, enlisted in the transaction.

public static IDbCommand CreateTextCommand(this IDbTransaction transaction, string commandText, int secondsTimeout = 60)

Parameters

transaction IDbTransaction

The transaction to create the command from.

commandText string

The command text to use.

secondsTimeout int

The number of seconds to wait before the command times out. The default is 60 seconds.

Returns

IDbCommand

A new IDbCommand that the caller owns and disposes. Its Transaction is transaction.

Exceptions

ArgumentException

commandText is empty or white space.

ArgumentNullException

transaction or commandText is null.

InvalidOperationException

The transaction has no connection.

CreateTextCommand(DbTransaction, string, int)

Creates a text DbCommand on the transaction's connection, enlisted in the transaction.

public static DbCommand CreateTextCommand(this DbTransaction transaction, string commandText, int secondsTimeout = 60)

Parameters

transaction DbTransaction

The transaction to create the command from.

commandText string

The command text to use.

secondsTimeout int

The number of seconds to wait before the command times out. The default is 60 seconds.

Returns

DbCommand

A new DbCommand that the caller owns and disposes. Its Transaction is transaction.

Exceptions

ArgumentException

commandText is empty or white space.

ArgumentNullException

transaction or commandText is null.

InvalidOperationException

The transaction has no connection.