Method CreateStoredProcedureCommand
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
CreateStoredProcedureCommand(IDbConnection, string, int)
Creates a stored procedure IDbCommand from a connection.
public static IDbCommand CreateStoredProcedureCommand(this IDbConnection connection, string commandText, int secondsTimeout = 60)
Parameters
connectionIDbConnectionThe connection to create the command from.
commandTextstringThe stored procedure name to use.
secondsTimeoutintThe number of seconds to wait before the command times out. The default is 60 seconds.
Returns
- IDbCommand
A new IDbCommand that the caller owns and disposes. It is not associated with a transaction.
Remarks
The connection is not opened by this method; open it (see EnsureOpen(IDbConnection)) before executing the command.
Exceptions
- ArgumentNullException
connectionorcommandTextis null.- ArgumentException
commandTextis empty or white space.
CreateStoredProcedureCommand(DbConnection, string, int)
Creates a stored procedure DbCommand from a DbConnection.
public static DbCommand CreateStoredProcedureCommand(this DbConnection connection, string procedureName, int secondsTimeout = 60)
Parameters
connectionDbConnectionThe connection 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
- DbCommand
A new DbCommand that the caller owns and disposes. It is not associated with a transaction.
Remarks
The connection is not opened by this method; open it (see EnsureOpen(IDbConnection)) before executing the command.
Exceptions
- ArgumentNullException
connectionorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.