Requirement is:
try
{
\\SQL Query
}
catch(Exception i)
{
print a
}
catch(SQLQueryException e)
{
\\SQL Query
}
Qu)I Got Exception in "try" block. Which "catch" statement
(i.e. 1st catch or 2nd catch ) catches the exception and
Why???
Answer Posted / sathish
There will be compile time error, becuase
the "..........catch(Exception ex)..........." is generic
exception block, where all type of exceptions are caught,
so when "catch(Exception ex)" is placed in the beginning,
then the following compile time error is thrown.
"A previous catch clause already catches all exceptions of
this or of a super type ('System.Exception')"
Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
What is route config?
What is ViewData and TempData in ASP.Net MVC?
what is entity graph in entity framework?
Is it possible to cancel filter execution?
What is entity framework in asp net?
In .net compact framework, can we free memory explicitly without waiting for garbage collector to free the memory?
How to answer for project questions..?
Explain what platforms does the .net framework run on?
what is csdl?
Explain how you can implement Ajax in MVC?
How does servicing work for the .net framework 3.0?
What is the difference between adding routes, to a webforms application and to an mvc application?
Is dapper better than entity framework?
Can you use Razor code in Javascript in ASP.Net MVC?
what is minimum requirement for entity framework applications to run?