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 work of clr?
What are the benefits of .net framework?
What is the difference between old ADO.NET and Entity framework coding techniques?
How do you specify comments using razor syntax?
what is linq to entities?
How to use multiple submit buttons in asp.net mvc?
What does a viewmodel do?
How do you assign a value to a complex number 7 how has exception hand changed in .net framework 4.0?
why DotNetFramework is included in building a software
Can I set the unlimited length for "maxjsonlength" property in config?
What are Validation Annotations?
explain what is ado.net entity framework?
What is entitytypes? : Entity framework
What is filters in web api?
How do you handle variable number of segments in a route definition?