Hi all,
I want to know difference of below one
1)
catch
{
}
2)
catch(Exception ex)
{
throw ex;
}
which one is the best if your using then what is the reason for that,and give some example...
plz reply
Using Catch Statement
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sunil Pandey6 reputationPosted Sep 11, 2013, 2:42 AM EDT
If you are using 1st point then you unable to know if your application stack some where because it not show you error message but
If you are using 2nd point then you able to know if your application stack some where.
but I recommend you to use below code :
try
{
decimal val = Convert.ToDecimal("WW");
}
catch(Exception ex)
{
MessageBox.Show (ex.Message.ToString());
}
VulpesRank #55 · 29.2K reputationPosted Sep 11, 2013, 3:34 AM EDT
If you include a 'throw' statement in the first catch block, then it will re-throw the current exception as the second catch block is already doing.
However, if you need access to the Exception object - so you can print out its Message property, say - then you must use the second catch block.
Suthish NairRank #92 · 22.8K reputationPosted Sep 13, 2013, 1:10 AM EDT