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
Is it possible to combine asp.net webforms and asp.mvc and develop a single web application?
What is Layout in ASP.Net MVC?
Explain tempdata in mvc?
Difference between ASP.NET MVC and ASP.NET WebForms?
Describe the .net framework architecture.
Explain dependency resolution?
Explain the .net framework.
What are the components of the .net framework.
What is Dependency Injection in ASP.Net MVC
What is edm in entity framework?
How does work clr?
what do you mean by navigation property?
Can I remove .net framework?
What is poco proxy? : Entity framework
If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?