Table of Contents

Method CreateCommand

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

CreateCommand(IDbTransaction, CommandType, string, int)

Shortcut for creating an IDbCommand from any IDbTransaction.

public static IDbCommand CreateCommand(this IDbTransaction transaction, CommandType type, string commandText, int secondsTimeout = 60)

Parameters

transaction IDbTransaction

The transaction to create a command from.

type CommandType

The command type. Text, StoredProcedure, or TableDirect.

commandText string

The command text or stored procedure name to use.

secondsTimeout int

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

Returns

IDbCommand

The created SqlCommand.

CreateCommand(DbTransaction, CommandType, string, int)

Shortcut for creating an DbCommand from any DbTransaction.

public static DbCommand CreateCommand(this DbTransaction transaction, CommandType type, string commandText, int secondsTimeout = 60)

Parameters

transaction DbTransaction

The transaction to create a command from.

type CommandType

The command type. Text, StoredProcedure, or TableDirect.

commandText string

The command text or stored procedure name to use.

secondsTimeout int

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

Returns

DbCommand

The created SqlCommand.