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...

Exception handling

Answer Posted / alb.shah

"An exception handler is a piece of code which will be
called when an exception occurs."

.NET Framework provides several classes to work with
exceptions. The keywords try, catch are used to handle
exceptions in .NET. You have to put the code (that can
cause an exception) in a try block. If an exception occurs
at any line of code inside a try block, the control of
execution will be transfered to the code inside the catch
block.
If any statement within the try block raises an exception,
the control of execution will be transfered to the first
line within the catch block. You can write the error
handling code in the catch block, like recording the error
message into a log file, sending an email to the
administrator about the problem occurred, showing an
appropriate error message to the user etc.
You can optionally use a 'finally' block along with the try-
catch. The 'finally' block is guaranteed to be executed
even if there is an exception.
If an exception is not 'handled' in code, the application
will crash and user will see an ugly message. Instead, you
can catch the exception, log the errors and show a friendly
message to the user.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the path instructions in xaml?

1053


Can we have a web application running without web.config file?

1033


Which property needs to be set for script manager control to extend the time before throwing time out expection if no response is received from the server?

1017


How to communicate via Remote proxy with Client? a)MarshalByRef b)Marshal by Value or Any thing else?

2072


Explain the overview of asp.net?

1078


What is the difference between session and viewstate?

1014


Why do we need url encoding?

1029


What is difference between asp.net and asp?

1092


What is directive in asp net?

1065


Difference between application events and session events

1076


What are the types of caching in asp.net?

1157


What is http post action?

1056


How do I publish my asp.net application to my isp's web server?

1127


What are the two properties that are common on every validation control?

1106


How do you deploy your asp.net application?

1098