Murach's C# 2005
How to handle exceptions and validate data

First, this chapter shows you how to use structured exception handling so you can make a bulletproof application. Then, it shows you the best ways to validate the data that the user enters so exceptions are avoided. Frankly, this is the best material on data validation that we've ever seen.

Chapter 7 How to handle exceptions and validate data
An introduction to exceptions 176
How exceptions work 176
How to display a dialog box 178
How to use structured exception handling 180
How to catch an exception 180
How to use the properties and methods of an exception 182
How to catch specific types of exceptions 184
How to throw an exception 186
The Future Value application with exception handling 188
How to validate data 190
How to validate a single entry 190
How to use generic methods to validate an entry 192
How to validate multiple entries 194
The Future Value application with data validation 196
The dialog boxes 196
The code 196




Murach's C#

Learn more about this book

View the table of contents

Add this book to your cart



Our Ironclad Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a full refund...no questions asked.