Chapter 3. Handling Exceptions

Terms you'll need to understand:

  • Exception

  • Try code block

  • Catch code block

  • Finally code block

  • Throw statement

  • Validation

  • KeyPress

  • ErrorProvider

Techniques you'll need to master:

  • Knowing the default application behavior that occurs when an unhandled exception is encountered .

  • Understanding the use of Try, Catch , and Finally code blocks.

  • Understanding the four techniques of user input validation: control choice, control state, keystroke validation, and full control validation.

In a perfect world, your code would run correctly every time. But in the real world, you need to handle unexpected problems when your code is running. The user might delete a critical file or enter invalid data. A network link to a server might fail just as you're transferring data. Or perhaps you simply didn't allow for a particular rare circumstance in your code.

Fortunately, the .NET Framework offers a robust set of tools for dealing with these unexpected problems. In this chapter, we'll look at two facets of dealing with problems in .NET. First, we'll demonstrate the programming that you can do to handle errors, allowing the user to make corrections when something goes wrong. Then, we'll demonstrate how you can use validation techniques to prevent bad data from being entered into your application in the first place. Consistent use of these techniques will help make your applications more robust and reliable.



Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 188

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net