C# Class Npgsql.NpgsqlParameter.NpgsqlParameter

Inheritance: System.Data.Common.DbParameter, ICloneable
显示文件 Open project: npgsql/npgsql

Private Properties

Property Type Description
Bind void
ClearBind void
ICloneable object
ResolveHandler void
ValidateAndGetLength int

Public Methods

Method Description
Clone ( ) : Npgsql.NpgsqlParameter

Creates a new NpgsqlParameter that is a copy of the current instance.

NpgsqlParameter ( ) : System

Initializes a new instance of the NpgsqlParameter class.

NpgsqlParameter ( String parameterName, object value ) : System

Initializes a new instance of the NpgsqlParameter class with the parameter name and a value of the new NpgsqlParameter.

When you specify an Object in the value parameter, the DbType is inferred from the .NET Framework type of the Object.

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

NpgsqlParameter ( string parameterName, DbType parameterType ) : System

Initializes a new instance of the NpgsqlParameter.

NpgsqlParameter ( string parameterName, DbType parameterType, int size ) : System

Initializes a new instance of the NpgsqlParameter.

NpgsqlParameter ( string parameterName, DbType parameterType, int size, string sourceColumn ) : System

Initializes a new instance of the NpgsqlParameter.

NpgsqlParameter ( string parameterName, DbType parameterType, int size, string sourceColumn, ParameterDirection direction, bool isNullable, byte precision, byte scale, DataRowVersion sourceVersion, object value ) : System

Initializes a new instance of the NpgsqlParameter.

NpgsqlParameter ( string parameterName, NpgsqlDbType parameterType ) : System

Initializes a new instance of the NpgsqlParameter class with the parameter name and the data type.

NpgsqlParameter ( string parameterName, NpgsqlDbType parameterType, int size ) : System

Initializes a new instance of the NpgsqlParameter.

NpgsqlParameter ( string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn ) : System

Initializes a new instance of the NpgsqlParameter

NpgsqlParameter ( string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn, ParameterDirection direction, bool isNullable, byte precision, byte scale, DataRowVersion sourceVersion, object value ) : System

Initializes a new instance of the NpgsqlParameter.

ResetDbType ( ) : void

Reset DBType.

Private Methods

Method Description
Bind ( TypeHandlerRegistry registry ) : void
ClearBind ( ) : void
ICloneable ( ) : object
ResolveHandler ( TypeHandlerRegistry registry ) : void
ValidateAndGetLength ( ) : int

Method Details

Clone() public method

Creates a new NpgsqlParameter that is a copy of the current instance.
public Clone ( ) : Npgsql.NpgsqlParameter
return Npgsql.NpgsqlParameter

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter class.
public NpgsqlParameter ( ) : System
return System

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter class with the parameter name and a value of the new NpgsqlParameter.

When you specify an Object in the value parameter, the DbType is inferred from the .NET Framework type of the Object.

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

public NpgsqlParameter ( String parameterName, object value ) : System
parameterName String The name of the parameter to map.
value object An Object that is the value of the NpgsqlParameter.
return System

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter.
public NpgsqlParameter ( string parameterName, DbType parameterType ) : System
parameterName string The name of the parameter to map.
parameterType DbType One of the DbType values.
return System

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter.
public NpgsqlParameter ( string parameterName, DbType parameterType, int size ) : System
parameterName string The name of the parameter to map.
parameterType DbType One of the DbType values.
size int The length of the parameter.
return System

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter.
public NpgsqlParameter ( string parameterName, DbType parameterType, int size, string sourceColumn ) : System
parameterName string The name of the parameter to map.
parameterType DbType One of the DbType values.
size int The length of the parameter.
sourceColumn string The name of the source column.
return System

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter.
public NpgsqlParameter ( string parameterName, DbType parameterType, int size, string sourceColumn, ParameterDirection direction, bool isNullable, byte precision, byte scale, DataRowVersion sourceVersion, object value ) : System
parameterName string The name of the parameter to map.
parameterType DbType One of the DbType values.
size int The length of the parameter.
sourceColumn string The name of the source column.
direction ParameterDirection One of the ParameterDirection values.
isNullable bool true if the value of the field can be null, otherwise false.
precision byte The total number of digits to the left and right of the decimal point to which /// Value is resolved.
scale byte The total number of decimal places to which /// Value is resolved.
sourceVersion DataRowVersion One of the DataRowVersion values.
value object An Object that is the value /// of the NpgsqlParameter.
return System

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter class with the parameter name and the data type.
public NpgsqlParameter ( string parameterName, NpgsqlDbType parameterType ) : System
parameterName string The name of the parameter to map.
parameterType NpgsqlDbType One of the DbType values.
return System

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter.
public NpgsqlParameter ( string parameterName, NpgsqlDbType parameterType, int size ) : System
parameterName string The name of the parameter to map.
parameterType NpgsqlDbType One of the NpgsqlDbType values.
size int The length of the parameter.
return System

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter
public NpgsqlParameter ( string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn ) : System
parameterName string The name of the parameter to map.
parameterType NpgsqlDbType One of the NpgsqlDbType values.
size int The length of the parameter.
sourceColumn string The name of the source column.
return System

NpgsqlParameter() public method

Initializes a new instance of the NpgsqlParameter.
public NpgsqlParameter ( string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn, ParameterDirection direction, bool isNullable, byte precision, byte scale, DataRowVersion sourceVersion, object value ) : System
parameterName string The name of the parameter to map.
parameterType NpgsqlDbType One of the NpgsqlDbType values.
size int The length of the parameter.
sourceColumn string The name of the source column.
direction ParameterDirection One of the ParameterDirection values.
isNullable bool true if the value of the field can be null, otherwise false.
precision byte The total number of digits to the left and right of the decimal point to which /// Value is resolved.
scale byte The total number of decimal places to which /// Value is resolved.
sourceVersion DataRowVersion One of the DataRowVersion values.
value object An Object that is the value /// of the NpgsqlParameter.
return System

ResetDbType() public method

Reset DBType.
public ResetDbType ( ) : void
return void