Error Handling in ASP.NET 4.5

The Exception Class

very exception class derives from the base class System.Exception.The .net Framework is full of predefined exception classes, such as NullReferenceException, IOException, SqlException, and so on. The Exception class includes the essential functionality for identifying any type of error. Here we will see some of the most important members in ASP.NET.very exception class derives from the …

The Exception Class Read More »

Catching Specific Exception

The Structured exception handling is particularly flexible because it allows you to catch specific types of exceptions. To do so, you Add multiple catch statement, each one identifying the type of exception (and providing a new variable to catch it in), as follows: Try { //Risky database code goes here. } Catch (System.Data.SqlClient.SqlException err) { …

Catching Specific Exception Read More »