In creating the test app I found the problem.  I'm not sure if it is a bug or not.

I have been using GetInt64().  In Postgres this equates to a bigint, but I defined my columns as integer.  The reader fails on the conversion from Int32 to Int64.  I hadn't hit this before because Sqlite is very permissive and dynamically adjusts the size of ints stored.

Obviously Int32->Int64 is a non-lossy conversion so it could be done automatically, but I don't know what is considered correct with respect to ADO.NET.

I can't remember why I used GetInt64() instead of GetInt32(), so I have to go back into my code to see if something necessitated that or not.

If for some reason you would still like my test app let me know and I will send it.

Thanks,
-Mont


On 11/9/05, Francisco Figueiredo Jr. <[EMAIL PROTECTED]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mont Rothstein wrote:
> I have just started trying to use the Npgsql provider and I have run
> into an issue.
>

:(

> All of my values are coming back from the database as strings,
> regardless of the type in the database.
>

What Npgsql version are you using? Also, what Postgresql version?


> Ex1: the statement "select my_long from my_table" when passed to
> ExecuteReader() and read with GetInt64(0) throws an exception
> complaining about not being able to convert the type.
>
> Ex: Reading all of the values from a row using GetValue() always returns
> a string.
>

Hmmm, this is really strange. Npgsql should be returning you the correct
type.

Could you send me your complete sample so I can check what can be happening?

Thanks in advance.

- --
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.pgfoundry.org/projects/npgsql
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org


- -------------
"Science without religion is lame;
religion without science is blind."

                  ~ Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBQ3H7WP7iFmsNzeXfAQIy1AgAnxTVARadg51yz+1Ecf2pgN9UU+didKWe
wTaAfzNCOoJgkZJIwnvVrYeGoKpAnlTcQK/mLl0PQFfhYJSziwI4wgUs9qB5UAiR
W7i53r5Z/C0zK9Pt0e7pqxEW9k2EEjKnnA3VDt0jV4zEwNzjJkhh7nn/tBkcSm6l
GbCdOS1M8WJlB/LwIQ2Pg24oNPyaua/QBtojpMvrkZcV/7RTxiws2n5i7GFZDWFc
wQMffv6qqeCAdqQTLlwR79QWDX1N6aMZkN/3m5TA81W32acnmFPUqKDwB2lL4bGS
8AIT90FDX9hxylJhfoXJ8VizSdH7NauW1iahnB3BMOWgeUEGibgbjQ==
=clHv
-----END PGP SIGNATURE-----





_______________________________________________________
Yahoo! Acesso Grátis: Internet rápida e grátis.
Instale o discador agora!
http://br.acesso.yahoo.com/

_______________________________________________
Npgsql-general mailing list
Npgsql-general@gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/npgsql-general

_______________________________________________
Npgsql-general mailing list
Npgsql-general@gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/npgsql-general

Reply via email to