C H A P T E R  11

Handling Exceptions

For the programs you write, you definitely care about fixing any errors or problems that are brought to your attention by the language compiler. However, there is a particular type of error that doesn’t happen during compile time; instead, it occurs at runtime. As you progress into more complex application development, you have more chances of getting such runtime errors, known as exceptions. They can occur because the application is trying to open a connection to a nonexistent database, open a file that doesn’t exist, or write to a file that is already open in read-only mode. This chapter will help you learn more about exceptions and how to handle them when they occur.

The System.Exception Class

In .NET, ...

Get Beginning C# 5.0 Databases, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.