Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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


Please Help Members By Posting Answers For Below Questions

What are the new enhancements done in default project template of asp.net mvc 4?

999


Can I uninstall microsoft .net framework?

973


What are action filters?

977


Which approach provides better support for test driven development - asp.net mvc or asp.net webforms?

923


What is mvc entity framework?

917


Where are the routing rules defined in an asp.net mvc application?

1000


What is difference between html.beginform and ajax.beginform?

946


What is clr? How does work clr & wht is work of clr?

984


which are the key concepts of entity data model?

1024


What are advantages of Dependency Injection (DI) in ASP.Net MVC?

1046


What is the meaning of unobtrusive javascript?

1003


What is the role of the jit compiler in .net framework?

1061


Can we free memory explicitly without waiting for garbage collector to free the memory in .net compact framework?

952


Is razor a server side?

932


Describe the .net framework architecture.

1020