PgSqlException's Message is empty

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
belidzs
Posts: 32
Joined: Wed 30 Sep 2009 12:07

PgSqlException's Message is empty

Post by 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!

Shalex
Devart Team
Posts: 8032
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 30 Nov 2009 11:59

We have reproduced the issue. We will notify you when it is fixed.

belidzs
Posts: 32
Joined: Wed 30 Sep 2009 12:07

Post by 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..

Shalex
Devart Team
Posts: 8032
Joined: Thu 14 Aug 2008 12:44

Post by 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: 8032
Joined: Thu 14 Aug 2008 12:44

Post by 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 .

Post Reply