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 different types of Caching techniques in ASP.NET?

969


Differences between “dataset” and “datareader”.

991


What are server side controls?

955


What are the 3 levels at which content pages can be attached to Master Page?

1056


Explain the difference between asp & asp.net.

981


What are the Types of session management in ASP.NET

996


How to do parallel database export in remote SQL Server in ESSL time track. It is working for local server but not working for remote SQL Server

6556


What are the namespaces used in asp.net mvc? : asp.net mvc

1019


What is intrinsic objects in asp.net?

1179


What is a query string in a url?

942


What is postback request?

940


What is a response cookie?

1069


What is the best Macanism to clear the Cache in asp.net

1188


What is the use of execute non query in asp.net?

929


How can we identify that the page is post back in asp net?

905