Table of Contents

Method CreateTextCommand

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.MSSqlClient.dll

CreateTextCommand(SqlTransaction, string, int)

Creates a text SqlCommand enlisted in a transaction.

public static SqlCommand CreateTextCommand(this SqlTransaction transaction, string procedureName, int secondsTimeout = 60)

Parameters

transaction SqlTransaction

The transaction to create the command from.

procedureName 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

SqlCommand

A new SqlCommand that the caller owns and disposes.

Exceptions

ArgumentNullException

transaction or procedureName is null.

ArgumentException

procedureName is empty or white space.