Class SqlParameterCollectionExtensions
This class adds extension methods which simplify setting SQL parameter values from .NET types.
Inheritance
Inherited Members
Namespace: ArgentSea.Sql
Assembly: ArgentSea.Sql.dll
Syntax
public static class SqlParameterCollectionExtensions
Methods
| Improve this Doc View SourceAddSqlBigIntInputParameter(DbParameterCollection, String, Int64)
Creates a parameter for providing a 64-bit signed integer (long) to a stored procedure.
Declaration
public static DbParameterCollection AddSqlBigIntInputParameter(this DbParameterCollection prms, string parameterName, long value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Int64 | value | A 64-bit signed integer value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlBigIntInputParameter(DbParameterCollection, String, Nullable<Int64>)
Creates a parameter for providing a 64-bit signed integer (long) or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlBigIntInputParameter(this DbParameterCollection prms, string parameterName, long? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Int64> | value | A 64-bit signed integer value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlBigIntOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a 64-bit signed integer (long) from a stored procedure.
Declaration
public static DbParameterCollection AddSqlBigIntOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlBinaryInputParameter(DbParameterCollection, String, Byte[], Int32)
Creates a parameter for providing a fixed-sized byte array to a stored procedure. A null reference will save DBNull.
Declaration
public static DbParameterCollection AddSqlBinaryInputParameter(this DbParameterCollection prms, string parameterName, byte[] value, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Byte[] | value | An array of bytes, or null. |
System.Int32 | length | The fixed number of bytes in the database column. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlBinaryOutputParameter(DbParameterCollection, String, Int32)
Creates a parameter for obtaining a fixed-sized byte array from a stored procedure.
Declaration
public static DbParameterCollection AddSqlBinaryOutputParameter(this DbParameterCollection prms, string parameterName, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Int32 | length | The fixed number of bytes in the database column. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlBitInputParameter(DbParameterCollection, String, Boolean)
Creates a parameter for providing a boolean value (bool) to a stored procedure.
Declaration
public static DbParameterCollection AddSqlBitInputParameter(this DbParameterCollection prms, string parameterName, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Boolean | value | A boolean value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlBitInputParameter(DbParameterCollection, String, Nullable<Boolean>)
Creates a parameter for providing a boolean value (bool) or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlBitInputParameter(this DbParameterCollection prms, string parameterName, bool? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Boolean> | value | A boolean value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlBitOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a boolean value (bool) from a stored procedure.
Declaration
public static DbParameterCollection AddSqlBitOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlCharInputParameter(DbParameterCollection, String, String, Int32, Int32)
Creates parameter for providing a fixed-length string or a DBNull value to a stored procedure, which is converted to the target ANSI code page (if possible).
Declaration
public static DbParameterCollection AddSqlCharInputParameter(this DbParameterCollection prms, string parameterName, string value, int length, int localeId)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.String | value | An empty string will be saved as a zero-length string; a null string will be saved as a database null value. |
System.Int32 | length | Specifies the number of characters in the string. If the original string value is smaller than this length, the returned value will be padded with spaces. |
System.Int32 | localeId | Specify the code page for ANSI conversions. For example, the value 1033 is U.S. English. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlCharOutputParameter(DbParameterCollection, String, Int32, Int32)
Creates parameter for obtaining a fixed-length string from a stored procedure, which has been converted from the source ANSI code page.
Declaration
public static DbParameterCollection AddSqlCharOutputParameter(this DbParameterCollection prms, string parameterName, int length, int localeId)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Int32 | length | Specifies the number of characters in the string. If the original string value is smaller than this length, the returned value will be padded with spaces. |
System.Int32 | localeId | Specify the code page for ANSI conversions. For example, the value 1033 is U.S. English. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateInputParameter(DbParameterCollection, String, DateTime)
Creates a parameter for providing a date (sans time) to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateInputParameter(this DbParameterCollection prms, string parameterName, DateTime value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.DateTime | value | A DateTime value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateInputParameter(DbParameterCollection, String, Nullable<DateTime>)
Creates a parameter for providing a date (sans time) or DbNull to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateInputParameter(this DbParameterCollection prms, string parameterName, DateTime? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.DateTime> | value | A DateTime value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a date (sans time) from a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateTime2InputParameter(DbParameterCollection, String, DateTime)
Creates a parameter for providing a date and time value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateTime2InputParameter(this DbParameterCollection prms, string parameterName, DateTime value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.DateTime | value | A date and time value . |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateTime2InputParameter(DbParameterCollection, String, Nullable<DateTime>)
Creates a parameter for providing a date and time value or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateTime2InputParameter(this DbParameterCollection prms, string parameterName, DateTime? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.DateTime> | value | A date and time value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateTime2OutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving date and time value from a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateTime2OutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateTimeInputParameter(DbParameterCollection, String, DateTime)
Creates a parameter for providing a date and time value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateTimeInputParameter(this DbParameterCollection prms, string parameterName, DateTime value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.DateTime | value | A date and time value . |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateTimeInputParameter(DbParameterCollection, String, Nullable<DateTime>)
Creates a parameter for providing a date and time value or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateTimeInputParameter(this DbParameterCollection prms, string parameterName, DateTime? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.DateTime> | value | A date and time value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateTimeOffsetInputParameter(DbParameterCollection, String, DateTimeOffset)
Creates a parameter for providing a DateTimeOffset value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateTimeOffsetInputParameter(this DbParameterCollection prms, string parameterName, DateTimeOffset value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.DateTimeOffset | value | A DateTimeOffset value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateTimeOffsetInputParameter(DbParameterCollection, String, Nullable<DateTimeOffset>)
Creates a parameter for providing a DateTimeOffset or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateTimeOffsetInputParameter(this DbParameterCollection prms, string parameterName, DateTimeOffset? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.DateTimeOffset> | value | A DateTimeOffset value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateTimeOffsetOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a DateTimeOffset from a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateTimeOffsetOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDateTimeOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a date and time value from a stored procedure.
Declaration
public static DbParameterCollection AddSqlDateTimeOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDecimalInputParameter(DbParameterCollection, String, Decimal, Byte, Byte)
Creates a parameter for providing a decmial value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDecimalInputParameter(this DbParameterCollection prms, string parameterName, decimal value, byte precision, byte scale)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Decimal | value | A decmial value . |
System.Byte | precision | |
System.Byte | scale |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDecimalInputParameter(DbParameterCollection, String, Nullable<Decimal>, Byte, Byte)
Creates a parameter for providing a decmial value or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlDecimalInputParameter(this DbParameterCollection prms, string parameterName, decimal? value, byte precision, byte scale)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Decimal> | value | A decmial value or null. |
System.Byte | precision | |
System.Byte | scale |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlDecimalOutputParameter(DbParameterCollection, String, Byte, Byte)
Creates an output parameter for retrieving a decmial value from a stored procedure.
Declaration
public static DbParameterCollection AddSqlDecimalOutputParameter(this DbParameterCollection prms, string parameterName, byte precision, byte scale)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Byte | precision | Specifies the maximum number of digits used to store the number (inclusive of both sides of the decimal point). |
System.Byte | scale | Specifies the number of digits used in the fractional portion of the number (i.e. digits to the right of the decimal point). |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlFloatInputParameter(DbParameterCollection, String, Double)
Creates a parameter for providing a 64-bit floating-point value (double) to a stored procedure. NaN will be converted to DbNull.
Declaration
public static DbParameterCollection AddSqlFloatInputParameter(this DbParameterCollection prms, string parameterName, double value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Double | value | A 64-bit floating-point value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlFloatInputParameter(DbParameterCollection, String, Nullable<Double>)
Creates a parameter for providing a 64-bit floating-point value (double) or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlFloatInputParameter(this DbParameterCollection prms, string parameterName, double? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Double> | value | A 64-bit floating-point value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlFloatOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a 64-bit floating-point value (double) from a stored procedure.
Declaration
public static DbParameterCollection AddSqlFloatOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlIntInputParameter(DbParameterCollection, String, Int32)
Creates a parameter for providing a 32-bit signed integer (int) to a stored procedure.
Declaration
public static DbParameterCollection AddSqlIntInputParameter(this DbParameterCollection prms, string parameterName, int value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Int32 | value | A 32-bit signed integer value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlIntInputParameter(DbParameterCollection, String, Nullable<Int32>)
Creates a parameter for providing a 32-bit signed integer (int) or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlIntInputParameter(this DbParameterCollection prms, string parameterName, int? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Int32> | value | A 32-bit signed integer value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlIntOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a 32-bit signed integer (int) from a stored procedure.
Declaration
public static DbParameterCollection AddSqlIntOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlMoneyInputParameter(DbParameterCollection, String, Decimal)
Creates a parameter for providing a decmial value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlMoneyInputParameter(this DbParameterCollection prms, string parameterName, decimal value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Decimal | value | A decmial value . |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlMoneyInputParameter(DbParameterCollection, String, Nullable<Decimal>)
Creates a parameter for providing a decmial value or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlMoneyInputParameter(this DbParameterCollection prms, string parameterName, decimal? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Decimal> | value | A decmial value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlMoneyOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a decmial value from a stored procedure.
Declaration
public static DbParameterCollection AddSqlMoneyOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlNCharInputParameter(DbParameterCollection, String, String, Int32)
Creates parameter for providing a fixed-length string or a DBNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlNCharInputParameter(this DbParameterCollection prms, string parameterName, string value, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.String | value | An empty string will be saved as a zero-length string; a null string will be saved as a database null value. |
System.Int32 | length | Specifies the number of characters in the string. If the original string value is smaller than this length, the returned value will be padded with spaces. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlNCharOutputParameter(DbParameterCollection, String, Int32)
Creates parameter for obtaining a fixed-length string from a stored procedure.
Declaration
public static DbParameterCollection AddSqlNCharOutputParameter(this DbParameterCollection prms, string parameterName, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Int32 | length | Specifies the number of characters in the string. If the original string value is smaller than this length, the returned value will be padded with spaces. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlNVarCharInputParameter(DbParameterCollection, String, String, Int32)
Creates parameter for providing a string or a DBNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlNVarCharInputParameter(this DbParameterCollection prms, string parameterName, string value, int maxLength)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.String | value | An empty string will be saved as a zero-length string; a null string will be saved as a database null value. |
System.Int32 | maxLength | This should match the size of the parameter, not the size of the input string (and certainly not the number of bytes). For nvarchar(max) parameters, specify -1. Setting the value correctly will help avoid plan cache pollution (when not using stored procedures) and minimize memory buffer allocations. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlNVarCharOutputParameter(DbParameterCollection, String, Int32)
Creates parameter for obtaining a string from a stored procedure.
Declaration
public static DbParameterCollection AddSqlNVarCharOutputParameter(this DbParameterCollection prms, string parameterName, int maxLength)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Int32 | maxLength |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlRealInputParameter(DbParameterCollection, String, Nullable<Single>)
Creates a parameter for providing a 32-bit floating-point value (float) or DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlRealInputParameter(this DbParameterCollection prms, string parameterName, float? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Single> | value | A 32-bit floating point value (float) or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlRealInputParameter(DbParameterCollection, String, Single)
Creates a parameter for providing a 32-bit floating-point value (float) to a stored procedure. NaN will be converted to DbNull.
Declaration
public static DbParameterCollection AddSqlRealInputParameter(this DbParameterCollection prms, string parameterName, float value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Single | value | A 32-bit floating point value (float). |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlRealOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a 32-bit floating-point value (float) from a stored procedure.
Declaration
public static DbParameterCollection AddSqlRealOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlSmallIntInputParameter(DbParameterCollection, String, Int16)
Creates a parameter for providing a 16-bit signed integer (short) to a stored procedure.
Declaration
public static DbParameterCollection AddSqlSmallIntInputParameter(this DbParameterCollection prms, string parameterName, short value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Int16 | value | A 16-bit signed integer value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlSmallIntInputParameter(DbParameterCollection, String, Nullable<Int16>)
Creates a parameter for providing a 16-bit signed integer (short) or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlSmallIntInputParameter(this DbParameterCollection prms, string parameterName, short? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Int16> | value | A 16-bit signed integer value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlSmallIntOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a 32-bit signed integer (short) from a stored procedure.
Declaration
public static DbParameterCollection AddSqlSmallIntOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlSmallMoneyInputParameter(DbParameterCollection, String, Decimal)
Creates a parameter for providing a decmial value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlSmallMoneyInputParameter(this DbParameterCollection prms, string parameterName, decimal value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Decimal | value | A decmial value . |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlSmallMoneyInputParameter(DbParameterCollection, String, Nullable<Decimal>)
Creates a parameter for providing a decmial value or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlSmallMoneyInputParameter(this DbParameterCollection prms, string parameterName, decimal? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Decimal> | value | A decmial value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlSmallMoneyOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a decmial value from a stored procedure.
Declaration
public static DbParameterCollection AddSqlSmallMoneyOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlTableValuedParameter(DbParameterCollection, String, IEnumerable<SqlDataRecord>)
Creates a parameter for providing a user-defined table to a stored procedure.
Declaration
public static DbParameterCollection AddSqlTableValuedParameter(this DbParameterCollection prms, string parameterName, IEnumerable<SqlDataRecord> value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Collections.Generic.IEnumerable<Microsoft.SqlServer.Server.SqlDataRecord> | value | A list of SqlDataRecord objects containing the table contents. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlTableValuedParameter<TModel>(DbParameterCollection, String, IEnumerable<TModel>, ILogger)
Creates a parameter for providing a user-defined table to a stored procedure.
Declaration
public static DbParameterCollection AddSqlTableValuedParameter<TModel>(this DbParameterCollection prms, string parameterName, IEnumerable<TModel> values, ILogger logger)
where TModel : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Collections.Generic.IEnumerable<TModel> | values | |
Microsoft.Extensions.Logging.ILogger | logger |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
Type Parameters
Name | Description |
---|---|
TModel |
AddSqlTableValuedParameter<TModel>(DbParameterCollection, String, IEnumerable<TModel>, IList<String>, ILogger)
Creates a parameter for providing a user-defined table to a stored procedure.
Declaration
public static DbParameterCollection AddSqlTableValuedParameter<TModel>(this DbParameterCollection prms, string parameterName, IEnumerable<TModel> values, IList<string> columnList, ILogger logger)
where TModel : class, new()
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Collections.Generic.IEnumerable<TModel> | values | |
System.Collections.Generic.IList<System.String> | columnList | |
Microsoft.Extensions.Logging.ILogger | logger |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
Type Parameters
Name | Description |
---|---|
TModel |
AddSqlTableValuedParameter<TShard, TRecord>(DbParameterCollection, String, IEnumerable<ShardKey<TShard, TRecord>>, String, SqlDbType, String, SqlDbType)
Declaration
public static DbParameterCollection AddSqlTableValuedParameter<TShard, TRecord>(this DbParameterCollection prms, string parameterName, IEnumerable<ShardKey<TShard, TRecord>> values, string shardIdName, SqlDbType shardIdType, string recordIdName, SqlDbType recordIdType)
where TShard : IComparable where TRecord : IComparable
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | |
System.String | parameterName | |
System.Collections.Generic.IEnumerable<ShardKey<TShard, TRecord>> | values | |
System.String | shardIdName | |
System.Data.SqlDbType | shardIdType | |
System.String | recordIdName | |
System.Data.SqlDbType | recordIdType |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection |
Type Parameters
Name | Description |
---|---|
TShard | |
TRecord |
AddSqlTableValuedParameter<TModel, TShard, TRecord>(DbParameterCollection, String, IEnumerable<TModel>, String, SqlDbType, String, SqlDbType)
Declaration
public static DbParameterCollection AddSqlTableValuedParameter<TModel, TShard, TRecord>(this DbParameterCollection prms, string parameterName, IEnumerable<TModel> values, string shardIdName, SqlDbType shardIdType, string recordIdName, SqlDbType recordIdType)
where TModel : IKeyedModel<TShard, TRecord> where TShard : IComparable where TRecord : IComparable
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | |
System.String | parameterName | |
System.Collections.Generic.IEnumerable<TModel> | values | |
System.String | shardIdName | |
System.Data.SqlDbType | shardIdType | |
System.String | recordIdName | |
System.Data.SqlDbType | recordIdType |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection |
Type Parameters
Name | Description |
---|---|
TModel | |
TShard | |
TRecord |
AddSqlTableValuedParameter<TShard, TRecord, TChild>(DbParameterCollection, String, IEnumerable<ShardChild<TShard, TRecord, TChild>>, String, SqlDbType, String, SqlDbType, String, SqlDbType)
Declaration
public static DbParameterCollection AddSqlTableValuedParameter<TShard, TRecord, TChild>(this DbParameterCollection prms, string parameterName, IEnumerable<ShardChild<TShard, TRecord, TChild>> values, string shardIdName, SqlDbType shardIdType, string recordIdName, SqlDbType recordIdType, string childIdName, SqlDbType childIdType)
where TShard : IComparable where TRecord : IComparable where TChild : IComparable
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | |
System.String | parameterName | |
System.Collections.Generic.IEnumerable<ShardChild<TShard, TRecord, TChild>> | values | |
System.String | shardIdName | |
System.Data.SqlDbType | shardIdType | |
System.String | recordIdName | |
System.Data.SqlDbType | recordIdType | |
System.String | childIdName | |
System.Data.SqlDbType | childIdType |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection |
Type Parameters
Name | Description |
---|---|
TShard | |
TRecord | |
TChild |
AddSqlTableValuedParameter<TModel, TShard, TRecord, TChild>(DbParameterCollection, String, IEnumerable<TModel>, String, SqlDbType, String, SqlDbType, String, SqlDbType)
Declaration
public static DbParameterCollection AddSqlTableValuedParameter<TModel, TShard, TRecord, TChild>(this DbParameterCollection prms, string parameterName, IEnumerable<TModel> values, string shardIdName, SqlDbType shardIdType, string recordIdName, SqlDbType recordIdType, string childIdName, SqlDbType childIdType)
where TModel : IKeyedChildModel<TShard, TRecord, TChild> where TShard : IComparable where TRecord : IComparable where TChild : IComparable
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | |
System.String | parameterName | |
System.Collections.Generic.IEnumerable<TModel> | values | |
System.String | shardIdName | |
System.Data.SqlDbType | shardIdType | |
System.String | recordIdName | |
System.Data.SqlDbType | recordIdType | |
System.String | childIdName | |
System.Data.SqlDbType | childIdType |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection |
Type Parameters
Name | Description |
---|---|
TModel | |
TShard | |
TRecord | |
TChild |
AddSqlTimeInputParameter(DbParameterCollection, String, Nullable<TimeSpan>)
Creates a parameter for providing a time value or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlTimeInputParameter(this DbParameterCollection prms, string parameterName, TimeSpan? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.TimeSpan> | value | A time value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlTimeInputParameter(DbParameterCollection, String, TimeSpan)
Creates a parameter for providing a time value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlTimeInputParameter(this DbParameterCollection prms, string parameterName, TimeSpan value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.TimeSpan | value | A time value . |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlTimeOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a time value from a stored procedure.
Declaration
public static DbParameterCollection AddSqlTimeOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlTinyIntInputParameter(DbParameterCollection, String, Byte)
Creates a parameter for providing a 8-bit unsigned integer (byte) to a stored procedure.
Declaration
public static DbParameterCollection AddSqlTinyIntInputParameter(this DbParameterCollection prms, string parameterName, byte value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Byte | value | An unsigned 8-bit integer value. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlTinyIntInputParameter(DbParameterCollection, String, Nullable<Byte>)
Creates a parameter for providing a 8-bit unsigned integer (byte) or a DbNull value to a stored procedure.
Declaration
public static DbParameterCollection AddSqlTinyIntInputParameter(this DbParameterCollection prms, string parameterName, byte? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Byte> | value | An unsigned 8-bit integer value or null. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlTinyIntOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a 32-bit signed integer (byte) from a stored procedure.
Declaration
public static DbParameterCollection AddSqlTinyIntOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlUniqueIdentifierInputParameter(DbParameterCollection, String, Guid)
Creates a parameter for providing a Guid or DBNull (via Guid.Empty) to a stored procedure.
Declaration
public static DbParameterCollection AddSqlUniqueIdentifierInputParameter(this DbParameterCollection prms, string parameterName, Guid value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Guid | value | A Guid value. Will convert Guild.Empty to DBNull. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlUniqueIdentifierInputParameter(DbParameterCollection, String, Nullable<Guid>)
Creates a parameter for providing a Guid or DBNull (via null value) to a stored procedure.
Declaration
public static DbParameterCollection AddSqlUniqueIdentifierInputParameter(this DbParameterCollection prms, string parameterName, Guid? value)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Nullable<System.Guid> | value |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlUniqueIdentifierOutputParameter(DbParameterCollection, String)
Creates an output parameter for retrieving a Guid from a stored procedure.
Declaration
public static DbParameterCollection AddSqlUniqueIdentifierOutputParameter(this DbParameterCollection prms, string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlVarBinaryInputParameter(DbParameterCollection, String, Byte[], Int32)
Creates a parameter for providing a variable-sized byte array to a stored procedure. A null reference will save DBNull.
Declaration
public static DbParameterCollection AddSqlVarBinaryInputParameter(this DbParameterCollection prms, string parameterName, byte[] value, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Byte[] | value | An array of bytes, or null. |
System.Int32 | length | The maximum allowable number of bytes in the database column. Use -1 for varbinary(max). |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlVarBinaryOutputParameter(DbParameterCollection, String, Int32)
Creates a parameter for obtaining a variable-sized byte array from a stored procedure.
Declaration
public static DbParameterCollection AddSqlVarBinaryOutputParameter(this DbParameterCollection prms, string parameterName, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Int32 | length | The maximum allowable number of bytes in the database column. Use -1 for varbinary(max). |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlVarCharInputParameter(DbParameterCollection, String, String, Int32, Int32)
Creates parameter for providing a string or a DBNull value to a stored procedure, which is converted to the target ANSI code page (if possible).
Declaration
public static DbParameterCollection AddSqlVarCharInputParameter(this DbParameterCollection prms, string parameterName, string value, int maxLength, int localeId)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.String | value | An empty string will be saved as a zero-length string; a null string will be saved as a database null value. |
System.Int32 | maxLength | This should match the size of the parameter, not the size of the input string (and certainly not the number of bytes). For nvarchar(max) parameters, specify -1. Setting the value correctly will help avoid plan cache pollution (when not using stored procedures) and minimize memory buffer allocations. |
System.Int32 | localeId | Specify the code page for ANSI conversions. For example, the value 1033 is U.S. English. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |
AddSqlVarCharOutputParameter(DbParameterCollection, String, Int32, Int32)
Creates parameter for obtaining a string from a stored procedure, which has been converted from the source ANSI code page.
Declaration
public static DbParameterCollection AddSqlVarCharOutputParameter(this DbParameterCollection prms, string parameterName, int maxLength, int localeId)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbParameterCollection | prms | The existing parameter collection to which this output parameter should be added. |
System.String | parameterName | The name of the parameter. If the name doesn’t start with “@”, it will be automatically pre-pended. |
System.Int32 | maxLength | This should match the size of the parameter, not the size of the input string (and certainly not the number of bytes). For nvarchar(max) parameters, specify -1. Setting the value correctly will help avoid plan cache pollution (when not using stored procedures) and minimize memory buffer allocations. |
System.Int32 | localeId | Specify the code page for ANSI conversions. For example, the value 1033 is U.S. English. |
Returns
Type | Description |
---|---|
System.Data.Common.DbParameterCollection | The DbParameterCollection to which the parameter was appended. |