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


Please Help Members By Posting Answers For Below Questions

What are the sub types of ActionResult?

849


what is split entity?

837


What is the difference between viewbag and viewdata in mvc?

765


What is ViewData and TempData in ASP.Net MVC?

810


What are the new enhancements done in default project template of asp.net mvc 4?

823


Will c# 3.0, vb.net 9.0, atlas, or linq be included in the .net framework 3.0?

737


What is the difference between adding routes, to a webforms application and to an mvc application?

787


Can you please explain the request flow in ASP.NET MVC framework?

881


Which version of the common language runtime (clr) does the .net framework 3.0 use?

816


What is session state management?

802


What is the "helperpage.isajax" property?

918


how to disable the lazy loading framework?

820


Which are the important namespaces used in mvc?

946


Explain what is asp.net mvc?

906


What is code first? : Entity framework

811