Search Results for

    Show / Hide Table of Contents

    Class NpgsqlParameterCollection

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Inheritance
    Object
    MarshalByRefObject
    DbParameterCollection
    NpgsqlParameterCollection
    Implements
    IDataParameterCollection
    IList
    ICollection
    IList<NpgsqlParameter>
    ICollection<NpgsqlParameter>
    IEnumerable<NpgsqlParameter>
    IEnumerable
    Inherited Members
    System.Data.Common.DbParameterCollection.System.Collections.IList.get_Item(System.Int32)
    System.Data.Common.DbParameterCollection.System.Collections.IList.set_Item(System.Int32, System.Object)
    System.Data.Common.DbParameterCollection.System.Data.IDataParameterCollection.get_Item(System.String)
    System.Data.Common.DbParameterCollection.System.Data.IDataParameterCollection.set_Item(System.String, System.Object)
    DbParameterCollection.IList.Item[Int32]
    DbParameterCollection.IDataParameterCollection.Item[String]
    MarshalByRefObject.GetLifetimeService()
    MarshalByRefObject.InitializeLifetimeService()
    MarshalByRefObject.MemberwiseClone(Boolean)
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Npgsql
    Assembly: Npgsql.dll
    Syntax
    public sealed class NpgsqlParameterCollection : DbParameterCollection, IDataParameterCollection, IList, ICollection, IList<NpgsqlParameter>, ICollection<NpgsqlParameter>, IEnumerable<NpgsqlParameter>, IEnumerable

    Properties

    | Improve this Doc View Source

    Count

    Gets the number of NpgsqlParameter objects in the collection.

    Declaration
    public override int Count { get; }
    Property Value
    Type Description
    Int32

    The number of NpgsqlParameter objects in the collection.

    Overrides
    DbParameterCollection.Count
    | Improve this Doc View Source

    IsFixedSize

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override bool IsFixedSize { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    DbParameterCollection.IsFixedSize
    | Improve this Doc View Source

    IsReadOnly

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override bool IsReadOnly { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    DbParameterCollection.IsReadOnly
    | Improve this Doc View Source

    IsSynchronized

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override bool IsSynchronized { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    DbParameterCollection.IsSynchronized
    | Improve this Doc View Source

    Item[Int32]

    Gets the NpgsqlParameter at the specified index.

    Declaration
    public NpgsqlParameter this[int index] { get; set; }
    Parameters
    Type Name Description
    Int32 index

    The zero-based index of the NpgsqlParameter to retrieve.

    Property Value
    Type Description
    NpgsqlParameter

    The NpgsqlParameter at the specified index.

    | Improve this Doc View Source

    Item[String]

    Gets the NpgsqlParameter with the specified name.

    Declaration
    public NpgsqlParameter this[string parameterName] { get; set; }
    Parameters
    Type Name Description
    String parameterName

    The name of the NpgsqlParameter to retrieve.

    Property Value
    Type Description
    NpgsqlParameter

    The NpgsqlParameter with the specified name, or a null reference if the parameter is not found.

    | Improve this Doc View Source

    SyncRoot

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override object SyncRoot { get; }
    Property Value
    Type Description
    Object
    Overrides
    DbParameterCollection.SyncRoot

    Methods

    | Improve this Doc View Source

    Add(NpgsqlParameter)

    Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection.

    Declaration
    public NpgsqlParameter Add(NpgsqlParameter value)
    Parameters
    Type Name Description
    NpgsqlParameter value

    The NpgsqlParameter to add to the collection.

    Returns
    Type Description
    NpgsqlParameter

    The index of the new NpgsqlParameter object.

    | Improve this Doc View Source

    Add(Object)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override int Add(object value)
    Parameters
    Type Name Description
    Object value
    Returns
    Type Description
    Int32
    Overrides
    DbParameterCollection.Add(Object)
    | Improve this Doc View Source

    Add(String, NpgsqlDbType, Int32, String)

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

    Declaration
    public NpgsqlParameter Add(string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn)
    Parameters
    Type Name Description
    String parameterName

    The name of the parameter.

    NpgsqlDbType parameterType

    One of the DbType values.

    Int32 size

    The length of the column.

    String sourceColumn

    The name of the source column.

    Returns
    Type Description
    NpgsqlParameter

    The index of the new NpgsqlParameter object.

    | Improve this Doc View Source

    Add(String, NpgsqlDbType, Int32)

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

    Declaration
    public NpgsqlParameter Add(string parameterName, NpgsqlDbType parameterType, int size)
    Parameters
    Type Name Description
    String parameterName

    The name of the parameter.

    NpgsqlDbType parameterType

    One of the DbType values.

    Int32 size

    The length of the column.

    Returns
    Type Description
    NpgsqlParameter

    The index of the new NpgsqlParameter object.

    | Improve this Doc View Source

    Add(String, NpgsqlDbType)

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

    Declaration
    public NpgsqlParameter Add(string parameterName, NpgsqlDbType parameterType)
    Parameters
    Type Name Description
    String parameterName

    The name of the parameter.

    NpgsqlDbType parameterType

    One of the DbType values.

    Returns
    Type Description
    NpgsqlParameter

    The index of the new NpgsqlParameter object.

    | Improve this Doc View Source

    AddRange(Array)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override void AddRange(Array values)
    Parameters
    Type Name Description
    Array values
    Overrides
    DbParameterCollection.AddRange(Array)
    | Improve this Doc View Source

    AddWithValue(NpgsqlDbType, Object)

    Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified data type and value.

    Declaration
    public NpgsqlParameter AddWithValue(NpgsqlDbType parameterType, object value)
    Parameters
    Type Name Description
    NpgsqlDbType parameterType

    One of the NpgsqlDbType values.

    Object value

    The value of the NpgsqlParameter to add to the collection.

    Returns
    Type Description
    NpgsqlParameter

    The parameter that was added.

    | Improve this Doc View Source

    AddWithValue(Object)

    Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified value.

    Declaration
    public NpgsqlParameter AddWithValue(object value)
    Parameters
    Type Name Description
    Object value

    The value of the NpgsqlParameter to add to the collection.

    Returns
    Type Description
    NpgsqlParameter

    The parameter that was added.

    | Improve this Doc View Source

    AddWithValue(String, NpgsqlDbType, Int32, Object)

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

    Declaration
    public NpgsqlParameter AddWithValue(string parameterName, NpgsqlDbType parameterType, int size, object value)
    Parameters
    Type Name Description
    String parameterName

    The name of the NpgsqlParameter.

    NpgsqlDbType parameterType

    One of the NpgsqlDbType values.

    Int32 size

    The length of the column.

    Object value

    The value of the NpgsqlParameter to add to the collection.

    Returns
    Type Description
    NpgsqlParameter

    The parameter that was added.

    | Improve this Doc View Source

    AddWithValue(String, NpgsqlDbType, Int32, String, Object)

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

    Declaration
    public NpgsqlParameter AddWithValue(string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn, object value)
    Parameters
    Type Name Description
    String parameterName

    The name of the NpgsqlParameter.

    NpgsqlDbType parameterType

    One of the NpgsqlDbType values.

    Int32 size

    The length of the column.

    String sourceColumn

    The name of the source column.

    Object value

    The value of the NpgsqlParameter to add to the collection.

    Returns
    Type Description
    NpgsqlParameter

    The parameter that was added.

    | Improve this Doc View Source

    AddWithValue(String, NpgsqlDbType, Object)

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

    Declaration
    public NpgsqlParameter AddWithValue(string parameterName, NpgsqlDbType parameterType, object value)
    Parameters
    Type Name Description
    String parameterName

    The name of the NpgsqlParameter.

    NpgsqlDbType parameterType

    One of the NpgsqlDbType values.

    Object value

    The value of the NpgsqlParameter to add to the collection.

    Returns
    Type Description
    NpgsqlParameter

    The parameter that was added.

    | Improve this Doc View Source

    AddWithValue(String, Object)

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

    Declaration
    public NpgsqlParameter AddWithValue(string parameterName, object value)
    Parameters
    Type Name Description
    String parameterName

    The name of the NpgsqlParameter.

    Object value

    The value of the NpgsqlParameter to add to the collection.

    Returns
    Type Description
    NpgsqlParameter

    The parameter that was added.

    | Improve this Doc View Source

    Clear()

    Removes all items from the collection.

    Declaration
    public override void Clear()
    Overrides
    DbParameterCollection.Clear()
    | Improve this Doc View Source

    Contains(NpgsqlParameter)

    Report whether the specified parameter is present in the collection.

    Declaration
    public bool Contains(NpgsqlParameter item)
    Parameters
    Type Name Description
    NpgsqlParameter item

    Parameter to find.

    Returns
    Type Description
    Boolean

    True if the parameter was found, otherwise false.

    | Improve this Doc View Source

    Contains(Object)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override bool Contains(object value)
    Parameters
    Type Name Description
    Object value
    Returns
    Type Description
    Boolean
    Overrides
    DbParameterCollection.Contains(Object)
    | Improve this Doc View Source

    Contains(String)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override bool Contains(string parameterName)
    Parameters
    Type Name Description
    String parameterName
    Returns
    Type Description
    Boolean
    Overrides
    DbParameterCollection.Contains(String)
    | Improve this Doc View Source

    CopyTo(NpgsqlParameter[], Int32)

    Convert collection to a System.Array.

    Declaration
    public void CopyTo(NpgsqlParameter[] array, int arrayIndex)
    Parameters
    Type Name Description
    NpgsqlParameter[] array

    Destination array.

    Int32 arrayIndex

    Starting index in destination array.

    | Improve this Doc View Source

    CopyTo(Array, Int32)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override void CopyTo(Array array, int index)
    Parameters
    Type Name Description
    Array array
    Int32 index
    Overrides
    DbParameterCollection.CopyTo(Array, Int32)
    | Improve this Doc View Source

    GetEnumerator()

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override IEnumerator GetEnumerator()
    Returns
    Type Description
    IEnumerator
    Overrides
    DbParameterCollection.GetEnumerator()
    | Improve this Doc View Source

    GetParameter(Int32)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    protected override DbParameter GetParameter(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    DbParameter
    Overrides
    DbParameterCollection.GetParameter(Int32)
    | Improve this Doc View Source

    GetParameter(String)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    protected override DbParameter GetParameter(string parameterName)
    Parameters
    Type Name Description
    String parameterName
    Returns
    Type Description
    DbParameter
    Overrides
    DbParameterCollection.GetParameter(String)
    | Improve this Doc View Source

    IndexOf(NpgsqlParameter)

    Report the offset within the collection of the given parameter.

    Declaration
    public int IndexOf(NpgsqlParameter item)
    Parameters
    Type Name Description
    NpgsqlParameter item

    Parameter to find.

    Returns
    Type Description
    Int32

    Index of the parameter, or -1 if the parameter is not present.

    | Improve this Doc View Source

    IndexOf(Object)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override int IndexOf(object value)
    Parameters
    Type Name Description
    Object value
    Returns
    Type Description
    Int32
    Overrides
    DbParameterCollection.IndexOf(Object)
    | Improve this Doc View Source

    IndexOf(String)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override int IndexOf(string parameterName)
    Parameters
    Type Name Description
    String parameterName
    Returns
    Type Description
    Int32
    Overrides
    DbParameterCollection.IndexOf(String)
    | Improve this Doc View Source

    Insert(Int32, NpgsqlParameter)

    Insert the specified parameter into the collection.

    Declaration
    public void Insert(int index, NpgsqlParameter item)
    Parameters
    Type Name Description
    Int32 index

    Index of the existing parameter before which to insert the new one.

    NpgsqlParameter item

    Parameter to insert.

    | Improve this Doc View Source

    Insert(Int32, Object)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override void Insert(int index, object value)
    Parameters
    Type Name Description
    Int32 index
    Object value
    Overrides
    DbParameterCollection.Insert(Int32, Object)
    | Improve this Doc View Source

    Remove(NpgsqlParameter)

    Remove the specified parameter from the collection.

    Declaration
    public bool Remove(NpgsqlParameter item)
    Parameters
    Type Name Description
    NpgsqlParameter item

    Parameter to remove.

    Returns
    Type Description
    Boolean

    True if the parameter was found and removed, otherwise false.

    | Improve this Doc View Source

    Remove(Object)

    Removes the specified NpgsqlParameter from the collection.

    Declaration
    public override void Remove(object value)
    Parameters
    Type Name Description
    Object value

    The NpgsqlParameter to remove from the collection.

    Overrides
    DbParameterCollection.Remove(Object)
    | Improve this Doc View Source

    Remove(String)

    Removes the specified NpgsqlParameter from the collection.

    Declaration
    public void Remove(string parameterName)
    Parameters
    Type Name Description
    String parameterName

    The name of the NpgsqlParameter to remove from the collection.

    | Improve this Doc View Source

    RemoveAt(Int32)

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

    Declaration
    public override void RemoveAt(int index)
    Parameters
    Type Name Description
    Int32 index

    The zero-based index of the parameter.

    Overrides
    DbParameterCollection.RemoveAt(Int32)
    | Improve this Doc View Source

    RemoveAt(String)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    public override void RemoveAt(string parameterName)
    Parameters
    Type Name Description
    String parameterName
    Overrides
    DbParameterCollection.RemoveAt(String)
    | Improve this Doc View Source

    SetParameter(Int32, DbParameter)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    protected override void SetParameter(int index, DbParameter value)
    Parameters
    Type Name Description
    Int32 index
    DbParameter value
    Overrides
    DbParameterCollection.SetParameter(Int32, DbParameter)
    | Improve this Doc View Source

    SetParameter(String, DbParameter)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    protected override void SetParameter(string parameterName, DbParameter value)
    Parameters
    Type Name Description
    String parameterName
    DbParameter value
    Overrides
    DbParameterCollection.SetParameter(String, DbParameter)
    | Improve this Doc View Source

    ToArray()

    Convert collection to a System.Array.

    Declaration
    public NpgsqlParameter[] ToArray()
    Returns
    Type Description
    NpgsqlParameter[]

    NpgsqlParameter[]

    | Improve this Doc View Source

    TryGetValue(String, out NpgsqlParameter)

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

    Declaration
    public bool TryGetValue(string parameterName, out NpgsqlParameter parameter)
    Parameters
    Type Name Description
    String parameterName

    The name of the NpgsqlParameter object to find.

    NpgsqlParameter parameter

    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.

    Returns
    Type Description
    Boolean

    true if the collection contains the parameter and param will contain the parameter; otherwise, false.

    Explicit Interface Implementations

    | Improve this Doc View Source

    ICollection<NpgsqlParameter>.Add(NpgsqlParameter)

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    void ICollection<NpgsqlParameter>.Add(NpgsqlParameter item)
    Parameters
    Type Name Description
    NpgsqlParameter item
    | Improve this Doc View Source

    ICollection<NpgsqlParameter>.IsReadOnly

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    bool ICollection<NpgsqlParameter>.IsReadOnly { get; }
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    IEnumerable<NpgsqlParameter>.GetEnumerator()

    Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet.

    Declaration
    IEnumerator<NpgsqlParameter> IEnumerable<NpgsqlParameter>.GetEnumerator()
    Returns
    Type Description
    IEnumerator<NpgsqlParameter>

    Implements

    System.Data.IDataParameterCollection
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2022 The Npgsql Development Team