Edytuj

Udostępnij za pośrednictwem


DbExtensions.CreateParameter<T> Method

Definition

Creates a new SQL parameter using the given arguments.

public static System.Data.IDbDataParameter CreateParameter<T> (this System.Data.IDbCommand command, System.Data.ParameterDirection direction, string parameterName, T value, int? size = default, System.Data.DbType? dbType = default);
static member CreateParameter : System.Data.IDbCommand * System.Data.ParameterDirection * string * 'T * Nullable<int> * Nullable<System.Data.DbType> -> System.Data.IDbDataParameter
<Extension()>
Public Function CreateParameter(Of T) (command As IDbCommand, direction As ParameterDirection, parameterName As String, value As T, Optional size As Nullable(Of Integer) = Nothing, Optional dbType As Nullable(Of DbType) = Nothing) As IDbDataParameter

Type Parameters

T

The type of the parameter.

Parameters

command
IDbCommand

The command to use to create the parameter.

direction
ParameterDirection

The direction of the parameter.

parameterName
String

The name of the parameter.

value
T

The value of the parameter.

size
Nullable<Int32>

The size of the parameter value.

dbType
Nullable<DbType>

the DbType of the parameter.

Returns

A parameter created using the given arguments.

Applies to