Hi,
Requirement is:
try
{
\\SQL Query
}
catch(Exception i)
{
print a
}
catch(SQLQueryException e)
{
\\SQL Query
}
Got Exception in "try" block. Which "catch" throws
exception and Why???

Please provide the answer in detail..

Thanks for the help!!!

Answer Posted / syed

The generic exception (Catch(Exception e)) should be
written after all the specific exceptions are written.
if any specific exception is written after the general
exception that will be of no use, as for all the exceptions
that were encountered in the try block will be catched by
the generic exception.
hope u got it.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is il and c#?

764


Explain me what is encapsulation?

727


Explain the different types of proxy patterns?

901


Is the COM architecture same as .Net architecture? What is the difference between them (if at all there is)?

1749


What is STA in .NET?

820


Write the .net syntax for 'while loop'?

754


Please explain is the jit an interpreter?

810


What is the use of system.diagnostics.process class in .net?

731


Is there a way to suppress the finalize process inside the garbage collector forcibly in .net?

684


What is static constructor, when it will be fired?

716


What is manifest in .net?

814


State the various features present in .NET?

785


How to prepare parametrized (with more than one parameters) crystal report.pls tell me the code procedure, if any body can?

721


Which namespace is used to support multithearding in .NET?

748


What is deferred execution vs. Immediate execution in linq?

751