Method CreateTextCommand
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.MSSqlClient.dll
CreateTextCommand(SqlTransaction, string, int)
Creates a text SqlCommand on the transaction's connection, enlisted in the transaction.
public static SqlCommand CreateTextCommand(this SqlTransaction transaction, string commandText, int secondsTimeout = 60)
Parameters
transactionSqlTransactionThe transaction to create the command from.
commandTextstringThe command text 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. Its Transaction is
transaction.
Exceptions
- ArgumentException
commandTextis empty or white space.- ArgumentNullException
transactionorcommandTextis null.