User-434868552 posted
@bsurendiran welcome to forums.asp.net
if you do not have a try/catch, exceptions will be caught at some higher level in the call stack, or missed altogether and caught by the operating system ~~ worst case scenario, if the operating system can not catch the exception, you likely will crash your
computer.
Think of an exception as a bubble from the bottom of the ocean; as it bubbles up to the surface, it may get trapped on the way up to the top.
important, exceptions are hierarchical; for that reason, when you have multiple catch blocks, you stack them from more specific to less specific, if you try to stack them the wrong way around, the c# compiler will not let you.
try
{
}
catch (Exception ex)
{
}
catch (DivideByZeroException zdivex) // error
{
}
error: A previous catch clause already catches all exceptions
of this or of a super type ('System.Exception')
reference:
http://msdn.microsoft.com/en-us/library/5b2yeyab%28v=vs.110%29.aspx
"Handling and Throwing Exceptions"
edit:
you can throw and/or rethrow exceptions. see http://www.dotnetperls.com/throw (generally, you should be careful so as to not mess up your
StackTrace data.)
end edit.