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
transactionIDbTransactionThe transaction to create a command from.
typeCommandTypeThe command type. Text, StoredProcedure, or TableDirect.
commandTextstringThe command text or stored procedure name to use.
secondsTimeoutintThe 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
transactionDbTransactionThe transaction to create a command from.
typeCommandTypeThe command type. Text, StoredProcedure, or TableDirect.
commandTextstringThe command text or stored procedure name to use.
secondsTimeoutintThe number of seconds to wait before the command times out.
Returns
- DbCommand
The created SqlCommand.