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 new enhancements done in default project template of asp.net mvc 4?
Can I uninstall microsoft .net framework?
What are action filters?
Which approach provides better support for test driven development - asp.net mvc or asp.net webforms?
What is mvc entity framework?
Where are the routing rules defined in an asp.net mvc application?
What is difference between html.beginform and ajax.beginform?
What is clr? How does work clr & wht is work of clr?
which are the key concepts of entity data model?
What are advantages of Dependency Injection (DI) in ASP.Net MVC?
What is the meaning of unobtrusive javascript?
What is the role of the jit compiler in .net framework?
Can we free memory explicitly without waiting for garbage collector to free the memory in .net compact framework?
Is razor a server side?
Describe the .net framework architecture.