Possible Duplicate:
When and how should I use exception handling?
I have seen that programmer have “try{}catch(){}” block written in each method both in C# and
C++.
In C# it seems usual. But in C++ it seems obscure.
What is the right way to use them?
There are really only three times you should be using try/catch:
At the top level of your application so you can present a friendly error message to your user (and hopefully log some useful information so you can fix the problem later).
When you can properly recover from the Exception (or at least clean up resources that are no longer needed).
When you’re going to do something with the Exception information and then bubble the Exception up.
Other than those three situations, there’s no reason to use a try/catch block. You should just let the Exception bubble up to the caller so they can handle it if need be.