Table of Contents

Method CreateStoredProcedureCommand

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

CreateStoredProcedureCommand(SqlTransaction, string, int)

Creates a stored procedure SqlCommand on the transaction's connection, enlisted in the transaction.

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

Parameters

transaction SqlTransaction

The transaction to create the command from.

procedureName string

The stored procedure name.

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. Its Transaction is transaction.

Exceptions

ArgumentException

procedureName is empty or white space.

ArgumentNullException

transaction or procedureName is null.