[Mono-list] Npgsql myCommand.ExecuteScalar type cast issue

Christopher Bergström cbergstrom at netsyncro.com
Fri Dec 23 17:22:08 EST 2005

Joe Audette wrote:

>I think 
>i = Convert.ToInt32(myCommand.ExecuteScalar());
>will work
>Hope it helps,
It does help and thank you.. On the other hand it raises a question.. 
(Which if one of the Npgsql guys is on the list maybe he/she can answer)..

With SQL server the (int) type casting works.. Which brings the question 
of why not for Npgsql?  I mean.. It's returning either an object or a 
string.. (I think an object if I read the doc properly)  So I should be 
able to unbox it the same way?  This is looking like an undocumented 
feature and I'm thinking it's maybe on the Npgsql side of things..



More information about the Mono-list mailing list