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 are the sub types of ActionResult?
what is split entity?
What is the difference between viewbag and viewdata in mvc?
What is ViewData and TempData in ASP.Net MVC?
What are the new enhancements done in default project template of asp.net mvc 4?
Will c# 3.0, vb.net 9.0, atlas, or linq be included in the .net framework 3.0?
What is the difference between adding routes, to a webforms application and to an mvc application?
Can you please explain the request flow in ASP.NET MVC framework?
Which version of the common language runtime (clr) does the .net framework 3.0 use?
What is session state management?
What is the "helperpage.isajax" property?
how to disable the lazy loading framework?
Which are the important namespaces used in mvc?
Explain what is asp.net mvc?
What is code first? : Entity framework