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
What is the difference between session and application?
How do you change the session time-out value?
can any one find and tell the difference between dot net and php which one is best ? which one we get more salary? which one is stable and which one is best for freshers and also better in future and carrer ? which one we wil get more salary sir ? please send ur valuable suggestions to kiranpulsar2007@gmail.com
Do you know about caching with the datasource controls?
What is bson in web api?
How does http session work?
What are the server control tags in asp.net.?
Why is the standalone environment only useful during the development process?
How does asp.net page work?
i want to implement grid view value in paypal site. so how to create this code in asp.net with C#
To bind columns manually which tags do you need to add within the asp:datagrid ?
How do I know asp.net mvc version? : Asp.Net MVC
What is the difference between ldap and active directory?
What is base class of .net?
if i wanna deploy my asp.net project to the production server and situation is that i m still not compiled my project i have as-is on my development side now on production server we dont have a visual studio now what kind of settings i need to be to do in webconfig /machine.config file to deploy my project and in iis too....