Page 1 of 1

PgSqlException's Message is empty

Posted: Sun 29 Nov 2009 19:29
by belidzs
hi,

since I upgraded to 4.65.54.0, my login controller method stopped working, since in case of connecting to a PostgreSQL 8.4.1 with bad credentials doesn't generate a meaningful exception.

Code: Select all

 private bool validateConnection(string user, string pass)
        {
            //kapcsolat felepitese a belepesi alapjan
            try
            {
                myConn.UserId = user;
                myConn.Password = pass;
                this.myConn.Open();
                //sikeres nyitas eseten belepes naplozasa
                loginloggerPgSqlCommand.ExecuteNonQuery();
                return true;
            }
            catch (PgSqlException ex)
            {
                if (ex.Message.Contains("password authentication failed"))
                {
                    MessageBox.Show("Hibás felhasználónév vagy jelszó!", "Hibás adatok", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    badLoginCount++;
                    //harom rossz probalkozasnal kilepes
                    if (badLoginCount >= 3)
                    {
                        Application.Exit();
                    }
                }
                else
                {
                    MessageBox.Show("Hiba a kapcsolódás során, a szoftver most kilép!\n\n" + ex.Message, "Adatbáziskapcsolat hiba", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                }
                textBoxJelszo.Clear();
                textBoxLogin.SelectAll();
                textBoxLogin.Focus();
                return false;
            }
        }
In the code above ex.Message is always empty. Could you provide me a fix?

Thanks!

Posted: Mon 30 Nov 2009 11:59
by Shalex
We have reproduced the issue. We will notify you when it is fixed.

Posted: Mon 14 Dec 2009 12:06
by belidzs
Shalex wrote:We have reproduced the issue. We will notify you when it is fixed.
Is it fixed already? It has been two weeks passed since I reported the bug..

Posted: Mon 14 Dec 2009 14:02
by Shalex
The bug with empty Message property of PgSqlException is fixed. Look forward to the next build of dotConnect for PostgreSQL that will be available in the end of this week.

Posted: Fri 18 Dec 2009 09:48
by Shalex
The new 4.65.62 build of dotConnect for PostgreSQL is available for download now.
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=16682 .