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
Is LINQ performance wise better or using sqlcommand?
Is it possible to change the index of primary key on table?
Which object encapsulates state or data of a user?
How can we pass info between 2 asp.net pages?
How can we create Tree control in asp.net?
What are the advantages of using session?
how to implement some securty aspect in our application i.e 1.cookie poisioning. 2.data encryption. 3.forcefull browsing 4.sql/code injection 5.securing web app by using web services ........my question is how to implement these thing in our application is this done by hard coding or by help of some tool
How to improve performance of web application asp.net mvc? : Asp.Net MVC
How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?
Are cookies stored on server or client?
What is the state management in asp.net?
What is the use of ASP.NET routing?
Write the different features of a Thread and a Process?
What is css and what is it used for?
What are the different kinds of assemblies?