BUG #6409: [NPGSQL]Fail to cast Int64 to System.Data.Common.DbParameter - Mailing list pgsql-bugs

From aaron.kb.h@gmail.com
Subject BUG #6409: [NPGSQL]Fail to cast Int64 to System.Data.Common.DbParameter
Date
Msg-id E1RqIwo-0007dl-Dq@wrigleys.postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      6409
Logged by:          AaronHuang
Email address:      aaron.kb.h@gmail.com
PostgreSQL version: 9.1.2
Operating system:   Windows 7 Ultimate
Description:=20=20=20=20=20=20=20=20

[Exception]
InvalidCastException:Unable to cast object of type 'System.Int64' to type
'System.Data.Common.DbParameter'.
[callstack]
   at
System.Data.Common.DbParameterCollection.System.Collections.IList.set_Item(=
Int32
index, Object value)
   at Kelly.TcsStatus.BackUp(DateTime fromTime, DateTime toTime, Int64[]
tcsIds, Int64[] statusIds, Int32[] versions) in XXXXX

[important]
I use IDbCommand than NpgsqlCommand.=20

[code sample (not runable, only FYI)]
Int64 id =3D 100;
...
IDbCommand cmd =3D conn.CreateCommand();
NpgsqlParameter pkParameter =3D new NpgsqlParameter("id",
NpgsqlDbType.Bigint);
...
cmd.Parameters.Add(pkParameter);
...
cmd.Parameters[0] =3D id;// throw exception here.

pgsql-bugs by date:

Previous
From: Dave Page
Date:
Subject: Re: Windows x86-64 One-Click Install (9.1.2-1, 9.0.6-1) hangs on "initialising the database cluster" (with work-around)
Next
From: Sasa.Petrovic@falc.biz
Date:
Subject: One question about VACUUMDB command - please