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 is work of clr?

943


What are the benefits of .net framework?

946


What is the difference between old ADO.NET and Entity framework coding techniques?

944


How do you specify comments using razor syntax?

963


what is linq to entities?

1061


How to use multiple submit buttons in asp.net mvc?

1089


What does a viewmodel do?

955


How do you assign a value to a complex number 7 how has exception hand changed in .net framework 4.0?

882


why DotNetFramework is included in building a software

2618


Can I set the unlimited length for "maxjsonlength" property in config?

957


What are Validation Annotations?

970


explain what is ado.net entity framework?

994


What is entitytypes? : Entity framework

984


What is filters in web api?

923


How do you handle variable number of segments in a route definition?

919