I have some sophisticated error trapping using NpgsqlException .
But many of my SQL reads are in Postgresql and use PgSqlException for error trapping.
So, instead of using:
I want to use
And in my 'UsefulTools.cs ' I have a rather long list of error codes and what they mean.
So, will that work? Can I use NpgsqlException instead of PgSqlException?
Thanks!
But many of my SQL reads are in Postgresql and use PgSqlException for error trapping.
So, instead of using:
Code:
catch (PgSqlException ex)
{ MessageBox.Show(ex.ToString()); }
Code:
catch (NpgsqlException ex)
{
string errorx = UsefulTools.error_list(ex.Code);
MessageBox.Show("Error in reading table for reason " + errorx + "\n");
}
So, will that work? Can I use NpgsqlException instead of PgSqlException?
Thanks!