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 / meena

In try block the SQL query will be executed so the exception
will match the SQLException catch because all type of SQL
exception will be match in this SQLException

if we wrote normal query in try block then it will match
Exception catch

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the advantage of packaging over xcopy in .net?

760


Briefly describe the roles of clr in .net framework?

753


Explain the advantages and disadvantages of ASP.Net MVC over ASP.NET?

766


What is Dependency Injection in ASP.Net MVC

796


Is it possible to create a custom filter?

780


What is filters in web api?

738


Describe the roles of clr in .net framework.?

862


Explain peek method in tempdata in asp.net mvc?

838


why DotNetFramework is included in building a software

2463


Explain unit test done by tester on development team?

757


What is ado.net data provider? : Entity framework

801


What is a model in programming?

776


What is route config?

750


how can you tell ef to have a different table or column name than that defined for the class?

823


what do you mean by navigation property?

810