Npgsql.NpgsqlParameterCollection.Insert C# (CSharp) Method

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
        public override void Insert(int index, object oValue)
        {
            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Insert", index, oValue);

            CheckType(oValue);

            NpgsqlParameter value = oValue as NpgsqlParameter;

            if (value.Collection != null)
            {
                throw new InvalidOperationException("The parameter already belongs to a collection");
            }

            value.Collection = this;
            this.InternalList.Insert(index, value);
            this.InvalidateHashLookups();
        }

Same methods

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