Method AddReturnParameter
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.MSSqlClient.dll
AddReturnParameter(SqlCommand, SqlDbType, string?)
Adds a typed return-value parameter to the command.
public static SqlParameter AddReturnParameter(this SqlCommand target, SqlDbType type, string? name = null)
Parameters
targetSqlCommandThe command to add the parameter to.
typeSqlDbTypeThe SqlDbType of the parameter.
namestringThe optional name of the parameter.
Returns
- SqlParameter
The created parameter, which has already been added to the command's parameter collection. Read its value after the command has executed.
Exceptions
- ArgumentNullException
targetis null.- ArgumentException
nameis empty or white space.