Method CreateStoredProcedureCommand
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.MSSqlClient.dll
CreateStoredProcedureCommand(SqlTransaction, string, int)
Creates a stored procedure SqlCommand enlisted in a transaction.
public static SqlCommand CreateStoredProcedureCommand(this SqlTransaction transaction, string procedureName, int secondsTimeout = 60)
Parameters
transactionSqlTransactionThe transaction to create the command from.
procedureNamestringThe stored procedure name to use.
secondsTimeoutintThe 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
transactionorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.