Method AddParam
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.MSSqlClient.dll
AddParam(string, DbType, ParameterDirection)
Adds a parameter of a DbType with no value, for example an output parameter: AddParam("@id", DbType.Int32, ParameterDirection.Output).
public ExpressiveSqlCommand AddParam(string name, DbType type, ParameterDirection direction)
Parameters
namestringThe name of the parameter.
typeDbTypeThe database type of the parameter.
directionParameterDirectionThe direction of the parameter. An input or input-output parameter with no value is sent as a NULL of that type.
Returns
- ExpressiveSqlCommand
This instance for use in method chaining.
Remarks
A constant 0 with a direction (AddParam("@n", 0, ParameterDirection.InputOutput)) binds to this overload as a DbType: write (object)0 or use a variable.
Exceptions
- ArgumentNullException
nameis null.- ArgumentException
nameis empty or white space, or SQL Server has no type fortype.