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

First, this chapter shows you how to use structured exception handling so you can create bulletproof applications. 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 182
How exceptions work 182
How to display a dialog box 184
How to use structured exception handling 186
How to catch an exception 186
How to use the properties and methods of an exception 188
How to catch specific types of exceptions 190
How to throw an exception 192
The Future Value application with exception handling 194
How to validate data 196
How to validate a single entry 196
How to use generic methods to validate an entry 198
How to validate multiple entries 200
The Future Value application with data validation 202
The dialog boxes 202
The code 202




Murach's C# 2008

Learn more about this book

View the table of contents


More about the eBook



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.