Home > Articles

  • Print
  • + Share This
This chapter is from the book

Chapter Summary

The .NET Framework includes thorough support for exception handling. In fact, it allows you to raise exceptions in one language and catch them in a program written in another language. A Try block should enclose any code that can cause exceptions. A Catch block is used to handle the exceptions raised by the code in the Try block, and the Finally block contains code that will be executed irrespective of the occurrence of an exception.

The Framework Class Library (FCL) provides a large number of Exception classes that represent most of the exceptions that your program can encounter. If you prefer to create your own custom exception class, you can do so by deriving your exception class from the ApplicationException class.

You also learned variety of ways in which to validate user input. The Windows Forms library includes an ErrorProvider component to inform the user of errors. You can also associate custom icons and error messages with the ErrorProvider object.


  • Exception

  • Exception handling

  • Input validation

  • + Share This
  • 🔖 Save To Your Account