The following bug has been logged on the website:
Bug reference: 6409
Logged by: AaronHuang
Email address: [email protected]
PostgreSQL version: 9.1.2
Operating system: Windows 7 Ultimate
Description:
[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.
[code sample (not runable, only FYI)]
Int64 id = 100;
...
IDbCommand cmd = conn.CreateCommand();
NpgsqlParameter pkParameter = new NpgsqlParameter("id",
NpgsqlDbType.Bigint);
...
cmd.Parameters.Add(pkParameter);
...
cmd.Parameters[0] = id;// throw exception here.
--
Sent via pgsql-bugs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs