DbExtensions.AddParameter<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates and adds a new SQL parameter to the command.
public static void AddParameter<T> (this System.Data.IDbCommand command, string parameterName, T value, System.Data.ParameterDirection direction = System.Data.ParameterDirection.Input, int? size = default, System.Data.DbType? dbType = default);
static member AddParameter : System.Data.IDbCommand * string * 'T * System.Data.ParameterDirection * Nullable<int> * Nullable<System.Data.DbType> -> unit
<Extension()>
Public Sub AddParameter(Of T) (command As IDbCommand, parameterName As String, value As T, Optional direction As ParameterDirection = System.Data.ParameterDirection.Input, Optional size As Nullable(Of Integer) = Nothing, Optional dbType As Nullable(Of DbType) = Nothing)
Type Parameters
- T
The type of the parameter.
Parameters
- command
- IDbCommand
The command to use to create the parameter.
- parameterName
- String
The name of the parameter.
- value
- T
The value of the parameter.
- direction
- ParameterDirection
The direction of the parameter.