PgSqlException's Message is empty

PgSqlException's Message is empty

Postby belidzs » Sun 29 Nov 2009 19:29

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!
belidzs
 
Posts: 29
Joined: Wed 30 Sep 2009 12:07

Postby Shalex » Mon 30 Nov 2009 11:59

We have reproduced the issue. We will notify you when it is fixed.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Postby belidzs » Mon 14 Dec 2009 12:06

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..
belidzs
 
Posts: 29
Joined: Wed 30 Sep 2009 12:07

Postby Shalex » Mon 14 Dec 2009 14:02

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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Postby Shalex » Fri 18 Dec 2009 09:48

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 .
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL