473,327 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Can PgSqlException and NpgsqlException be used interchangeably?

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:
Expand|Select|Wrap|Line Numbers
  1. catch (PgSqlException ex)
  2.             { MessageBox.Show(ex.ToString()); }
  3.  
I want to use
Expand|Select|Wrap|Line Numbers
  1. catch (NpgsqlException ex)
  2.      {
  3.       string errorx = UsefulTools.error_list(ex.Code);
  4.       MessageBox.Show("Error in reading table for reason " + errorx + "\n");
  5.       }
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!
Nov 4 '15 #1
0 2553

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: J. Campbell | last post by:
From reading this forum, it is my understanding that C++ doesn't require the compiler to keep code that does not manifest itself in any way to the user. For example, in the following: { for(int...
3
by: fabio de francesco | last post by:
Hello, I have a couple of years of experience with C++. I started studying C++ syntax, then I read the B.Stroustrup's book, and eventually I went through the N.Josuttis' book on how to program...
3
by: NickName | last post by:
Here's the situation, developers inherit a web app from someone, backend SQL db has about 120 user tables and the db is also being used by other apps. Developers don't have a list of user tables...
2
by: TadPole | last post by:
Hi all, My main problems are::::::::: 1. Set a value within a block container that can be used and changed by subsequent templates/block-containers/tables etc.. 2. get/determine/find the...
23
by: rohit | last post by:
Hi, In my couple of years of experience, I have never found a single instance where I needed to use unions and bitfields(though I have used structures).I was just imagining where would these find...
10
by: Not Available | last post by:
On the host server: namespace JCart.Common public class JCartConfiguration : IConfigurationSectionHandler private static String dbConnectionString; public static String ConnectionString { get...
1
by: steph | last post by:
Hi, I have a VC++ 6 project I migrated to vc 7++ DOTNET. * in a first step , I don't use Managed extension -> memory used is 16 Mo. * then I check "use managed extensions" in project properties...
14
by: 2005 | last post by:
If a Constructor can be used to initialize, when is memory is allocated / say the "new" operator etc? Thanks
1
by: Jim in Arizona | last post by:
On one page I have a datalist where a message is bound to a label. On another page I have the datalist which allows for the insert of new message as well as being able to edit those messages. The...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.