C# Class Npgsql.NpgsqlParameterCollection

Inheritance: System.MarshalByRefObject, IDataParameterCollection
显示文件 Open project: undeadlabs/Npgsql Class Usage Examples

Private Properties

Property Type Description
Add Npgsql.NpgsqlParameter
CheckType void
InvalidateHashLookups void
NpgsqlParameterCollection System
this Npgsql.NpgsqlParameter
this Npgsql.NpgsqlParameter

Public Methods

Method Description
Add ( Npgsql.NpgsqlParameter value ) : Npgsql.NpgsqlParameter

Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection.

Add ( string parameterName, NpgsqlDbType parameterType ) : Npgsql.NpgsqlParameter

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type.

Add ( string parameterName, NpgsqlDbType parameterType, int size ) : Npgsql.NpgsqlParameter

Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, and the column length.

Add ( string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn ) : Npgsql.NpgsqlParameter

Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, the column length, and the source column name.

Add ( object value ) : int

Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection.

AddRange ( Array values ) : void

Add an Array of parameters to the collection.

AddWithValue ( string parameterName, NpgsqlDbType parameterType, int size, object value ) : Npgsql.NpgsqlParameter

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.

AddWithValue ( string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn, object value ) : Npgsql.NpgsqlParameter

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.

AddWithValue ( string parameterName, NpgsqlDbType parameterType, object value ) : Npgsql.NpgsqlParameter

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.

AddWithValue ( string parameterName, object value ) : Npgsql.NpgsqlParameter

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.

Clear ( ) : void

Removes all items from the collection.

Contains ( Npgsql.NpgsqlParameter item ) : bool

Report whether the specified parameter is present in the collection.

Contains ( object value ) : bool

Gets a value indicating whether a NpgsqlParameter exists in the collection.

Contains ( string parameterName ) : bool

Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection.

CopyTo ( Array array, int index ) : void

Copies NpgsqlParameter objects from the NpgsqlParameterCollection to the specified array.

CopyTo ( Npgsql.NpgsqlParameter array, int arrayIndex ) : void

Convert collection to a System.Array.

GetEnumerator ( ) : IEnumerator

Returns an enumerator that can iterate through the collection.

IndexOf ( Npgsql.NpgsqlParameter item ) : int

Report the offset within the collection of the given parameter.

IndexOf ( object value ) : int

Gets the location of a NpgsqlParameter in the collection.

IndexOf ( string parameterName ) : int

Gets the location of the NpgsqlParameter in the collection with a specific parameter name.

Insert ( int index, Npgsql.NpgsqlParameter item ) : void

Insert the specified parameter into the collection.

Insert ( int index, object oValue ) : void

Inserts a NpgsqlParameter into the collection at the specified index.

Remove ( Npgsql.NpgsqlParameter item ) : bool

Remove the specified parameter from the collection.

Remove ( object oValue ) : void

Removes the specified NpgsqlParameter from the collection.

Remove ( string parameterName ) : void

Removes the specified NpgsqlParameter from the collection.

RemoveAt ( int index ) : void

Removes the specified NpgsqlParameter from the collection using a specific index.

RemoveAt ( string parameterName ) : void

Removes the specified NpgsqlParameter from the collection using the parameter name.

ToArray ( ) : Npgsql.NpgsqlParameter[]

Convert collection to a System.Array.

TryGetValue ( string parameterName, Npgsql.NpgsqlParameter &parameter ) : bool

Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection.

Protected Methods

Method Description
GetParameter ( int index ) : DbParameter

Get parameter.

GetParameter ( string parameterName ) : DbParameter

Get parameter.

SetParameter ( int index, DbParameter value ) : void

Set parameter.

SetParameter ( string parameterName, DbParameter value ) : void

Set parameter.

Private Methods

Method Description
Add ( string parameterName, object value ) : Npgsql.NpgsqlParameter
CheckType ( object Object ) : void

In methods taking an object as argument this method is used to verify that the argument has the type NpgsqlParameter

InvalidateHashLookups ( ) : void

Invalidate the hash lookup tables. This should be done any time a change may throw the lookups out of sync with the list.

NpgsqlParameterCollection ( ) : System

Initializes a new instance of the NpgsqlParameterCollection class.

this ( int index ) : Npgsql.NpgsqlParameter
this ( string parameterName ) : Npgsql.NpgsqlParameter

Method Details

Add() public method

Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection.
public Add ( Npgsql.NpgsqlParameter value ) : Npgsql.NpgsqlParameter
value Npgsql.NpgsqlParameter The NpgsqlParameter to add to the collection.
return Npgsql.NpgsqlParameter

Add() public method

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type.
public Add ( string parameterName, NpgsqlDbType parameterType ) : Npgsql.NpgsqlParameter
parameterName string The name of the parameter.
parameterType NpgsqlDbType One of the DbType values.
return Npgsql.NpgsqlParameter

Add() public method

Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, and the column length.
public Add ( string parameterName, NpgsqlDbType parameterType, int size ) : Npgsql.NpgsqlParameter
parameterName string The name of the parameter.
parameterType NpgsqlDbType One of the DbType values.
size int The length of the column.
return Npgsql.NpgsqlParameter

Add() public method

Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, the column length, and the source column name.
public Add ( string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn ) : Npgsql.NpgsqlParameter
parameterName string The name of the parameter.
parameterType NpgsqlDbType One of the DbType values.
size int The length of the column.
sourceColumn string The name of the source column.
return Npgsql.NpgsqlParameter

Add() public method

Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection.
public Add ( object value ) : int
value object The NpgsqlParameter to add to the collection.
return int

AddRange() public method

Add an Array of parameters to the collection.
public AddRange ( Array values ) : void
values System.Array Parameters to add.
return void

AddWithValue() public method

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.
public AddWithValue ( string parameterName, NpgsqlDbType parameterType, int size, object value ) : Npgsql.NpgsqlParameter
parameterName string The name of the NpgsqlParameter.
parameterType NpgsqlDbType One of the NpgsqlDbType values.
size int The length of the column.
value object The Value of the NpgsqlParameter to add to the collection.
return Npgsql.NpgsqlParameter

AddWithValue() public method

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.
public AddWithValue ( string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn, object value ) : Npgsql.NpgsqlParameter
parameterName string The name of the NpgsqlParameter.
parameterType NpgsqlDbType One of the NpgsqlDbType values.
size int The length of the column.
sourceColumn string The name of the source column.
value object The Value of the NpgsqlParameter to add to the collection.
return Npgsql.NpgsqlParameter

AddWithValue() public method

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.
public AddWithValue ( string parameterName, NpgsqlDbType parameterType, object value ) : Npgsql.NpgsqlParameter
parameterName string The name of the NpgsqlParameter.
parameterType NpgsqlDbType One of the NpgsqlDbType values.
value object The Value of the NpgsqlParameter to add to the collection.
return Npgsql.NpgsqlParameter

AddWithValue() public method

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.
public AddWithValue ( string parameterName, object value ) : Npgsql.NpgsqlParameter
parameterName string The name of the NpgsqlParameter.
value object The Value of the NpgsqlParameter to add to the collection.
return Npgsql.NpgsqlParameter

Clear() public method

Removes all items from the collection.
public Clear ( ) : void
return void

Contains() public method

Report whether the specified parameter is present in the collection.
public Contains ( Npgsql.NpgsqlParameter item ) : bool
item Npgsql.NpgsqlParameter Parameter to find.
return bool

Contains() public method

Gets a value indicating whether a NpgsqlParameter exists in the collection.
public Contains ( object value ) : bool
value object The value of the NpgsqlParameter object to find.
return bool

Contains() public method

Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection.
public Contains ( string parameterName ) : bool
parameterName string The name of the NpgsqlParameter object to find.
return bool

CopyTo() public method

Copies NpgsqlParameter objects from the NpgsqlParameterCollection to the specified array.
public CopyTo ( Array array, int index ) : void
array System.Array An Array to which to copy the NpgsqlParameter objects in the collection.
index int The starting index of the array.
return void

CopyTo() public method

Convert collection to a System.Array.
public CopyTo ( Npgsql.NpgsqlParameter array, int arrayIndex ) : void
array Npgsql.NpgsqlParameter Destination array.
arrayIndex int Starting index in destination array.
return void

GetEnumerator() public method

Returns an enumerator that can iterate through the collection.
public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetParameter() protected method

Get parameter.
protected GetParameter ( int index ) : DbParameter
index int
return DbParameter

GetParameter() protected method

Get parameter.
protected GetParameter ( string parameterName ) : DbParameter
parameterName string
return DbParameter

IndexOf() public method

Report the offset within the collection of the given parameter.
public IndexOf ( Npgsql.NpgsqlParameter item ) : int
item Npgsql.NpgsqlParameter Parameter to find.
return int

IndexOf() public method

Gets the location of a NpgsqlParameter in the collection.
public IndexOf ( object value ) : int
value object The value of the NpgsqlParameter object to find.
return int

IndexOf() public method

Gets the location of the NpgsqlParameter in the collection with a specific parameter name.
public IndexOf ( string parameterName ) : int
parameterName string The name of the NpgsqlParameter object to find.
return int

Insert() public method

Insert the specified parameter into the collection.
public Insert ( int index, Npgsql.NpgsqlParameter item ) : void
index int Index of the existing parameter before which to insert the new one.
item Npgsql.NpgsqlParameter Parameter to insert.
return void

Insert() public method

Inserts a NpgsqlParameter into the collection at the specified index.
public Insert ( int index, object oValue ) : void
index int The zero-based index where the parameter is to be inserted within the collection.
oValue object The NpgsqlParameter to add to the collection.
return void

Remove() public method

Remove the specified parameter from the collection.
public Remove ( Npgsql.NpgsqlParameter item ) : bool
item Npgsql.NpgsqlParameter Parameter to remove.
return bool

Remove() public method

Removes the specified NpgsqlParameter from the collection.
public Remove ( object oValue ) : void
oValue object The NpgsqlParameter to remove from the collection.
return void

Remove() public method

Removes the specified NpgsqlParameter from the collection.
public Remove ( string parameterName ) : void
parameterName string The name of the NpgsqlParameter to remove from the collection.
return void

RemoveAt() public method

Removes the specified NpgsqlParameter from the collection using a specific index.
public RemoveAt ( int index ) : void
index int The zero-based index of the parameter.
return void

RemoveAt() public method

Removes the specified NpgsqlParameter from the collection using the parameter name.
public RemoveAt ( string parameterName ) : void
parameterName string The name of the NpgsqlParameter object to retrieve.
return void

SetParameter() protected method

Set parameter.
protected SetParameter ( int index, DbParameter value ) : void
index int
value DbParameter
return void

SetParameter() protected method

Set parameter.
protected SetParameter ( string parameterName, DbParameter value ) : void
parameterName string
value DbParameter
return void

ToArray() public method

Convert collection to a System.Array.
public ToArray ( ) : Npgsql.NpgsqlParameter[]
return Npgsql.NpgsqlParameter[]

TryGetValue() public method

Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection.
public TryGetValue ( string parameterName, Npgsql.NpgsqlParameter &parameter ) : bool
parameterName string The name of the NpgsqlParameter object to find.
parameter Npgsql.NpgsqlParameter A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found.
return bool