Francisco Figueiredo Jr. wrote:
The below returns System.Int64-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joe Audette wrote: That's exactly what's going on.. Question is.. How do we handle it.. a) Make the type cast error more explicit? b) Somehow make it return Int32? I'm thinking this is pretty common error based on the offlist responses I got.. Could be helpful to document.. <snip> NpgsqlCommand myCommand = new NpgsqlCommand("SELECT COUNT(*) FROM tbl_users WHERE fld_varchar_username='"+txtUsername.Text+"' and fld_varchar_password='"+txtPassword.Text+"';", myConnection); // This should work for all results where SELECT COUNT (*) < Int64 and the result can be cast into an Int32 int i = (int)myCommand.ExecuteScalar(); </snip> Where and how do you want me to submit a test case if you still need more info? (I also posted this in the Npgsql forum as well. Once worked out I'll make sure to follow up and document everything there as well. Thanks C. |
_______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
