Table of Contents

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

name string

The name of the parameter.

type DbType

The database type of the parameter.

direction ParameterDirection

The 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

name is null.

ArgumentException

name is empty or white space, or SQL Server has no type for type.