Exceptions:
System.Exception class is the base class for all exceptions. Exceptions are provide a structured, uniform, and type-safe way of controlling both system level and application level abnormal conditions. It can be generated by system or can be generated programmatically.
System level Exceptions
System exceptions are derive directly from a base class System.SystemException. A System level Exception is normally thrown.when a nonrecoverable error has occurred, such as a database crash. These are common exceptions that are thrown by the .NET Common Language Runtime and used in almost all .Net applications.
Exception Syntax:
try
{
//exceptional code
}
catch
{
//why catch
}
Application level Exceptions
Application exceptions can be user defined exceptions thrown by the applications. If you are designing an application that needs to create its own exceptions class, you are advised to derive custom exceptions from the System.ApplicationException class. It is typically thrown when a recoverable error has occurred, such as an invalid input argument values to a business method. It will alert the client of application specific or business logic issues; they do not report system level exceptions In most cases, clients can be return to normal processing after solving application exceptions.