Version

CreateParameter(String,DbType,ParameterDirection) Method

Creates an implementation-specific database parameter with the specified type and directionality.
Syntax
'Declaration
 
Protected Overloads Overridable Function CreateParameter( _
   ByVal parameterName As String, _
   ByVal parameterType As DbType, _
   ByVal parameterDir As ParameterDirection _
) As IDbDataParameter
protected virtual IDbDataParameter CreateParameter( 
   string parameterName,
   DbType parameterType,
   ParameterDirection parameterDir
)

Parameters

parameterName
Name of the database parameter.
parameterType
Data type of the database parameter, selected from the list specified in the DbType enumeration.
parameterDir
Directionality of the database parameter, i.e., whether it is incoming, outgoing, both, or a return value.

Return Value

An implementation of IDbDataParameter that describes the parameter created in a database-independent way, but that is compatible with IDbCommand instances created from the current WebSchedule data provider Connection (for example, through CreateCommand).
Remarks

This factory method is called frequently in the early stages of data binding to populate the IParameterCollection of database commands necessary to complete the bind. Some data providers allow nameless parameters, but others do not. Therefore, inheritors calling CreateParameter are encouraged to specify a name for their parameter.

Developers having extended the DataParameterSurrogate class with the intention of using it with this WebSchedule data provider must override this method. Their implementation should supply the data provider with instances of their custom class. At bind-time, those instances will be converted to the appropriate implementation type through their IConvertible implementation (specifically, their override of ToType).

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also