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 / mathew m

it will give error

previous catch clause already catches all exceptions of
this or of a super type ('System.Exception')

b"z System.Exception is the MOTHER -"mathaji" of all
exception.So all will be caught intitally,after that no
exception remains...it will be ok if we put child exception
like "SQLQueryException" before Exception [mathaji:)]

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can add the css in mvc?

685


In .net compact framework, can we free memory explicitly without waiting for garbage collector to free the memory?

667


Is the following route definition a valid route definition? {controller}{action}/{id}

866


What is partialview in asp.net mvc?

679


I want to fetch data from datareader. i have three tables in datareader. i want to bind my two table with datagrid, then i want to fetch a value from my third table. do u have any idea pls help me. we use dr.nextresult() for multiple tables.

2261






What is a model in android?

574


Why to use “{resource}.axd/{*pathinfo}” in routing in mvc?

658


What is the difference between tempdata and viewbag?

582


Explain Sections is ASP.Net MVC?

693


Asp.net mvc application, makes use of settings at 2 places for routing to work correctly. What are these 2 places?

728


What is MVVM design pattern?

686


What is the difference between windows vista and .net framework 3.0 ?

618


How we can invoke child actions in ASP.Net MVC?

682


Explain Bundle.Config in ASP.Net MVC4?

650


What are Code Blocks in Views?

748