C#: Throw, Throw, Throw

It’s nice to be back here after a long hiatus due to project deadlines, non-stop coding and lots of caffeine intake. For today’s session, I would like to share a simple but helpful technique involving the different throw implementations for Try Catch statement. This technique helped me a lot especially when debugging an application or logging the errors encountered by an application.

So, what is the difference with the Throw statement, Throw ex statement and Throw new Exception ? In order for us to clearly grasp the concept let us take a look at the sample program below:

Continue reading