Here is the listing of C# programming examples on Exceptions.
C# Examples demonstrating various aspects of Exception Handling
An event that occurs during the program execution, which disrupts the normal flow of the program is called an Exception. IndexOutOfRange exception is thrown when an attempt is made to access an element of an array with an index that is outside the bounds of the array. Divide By Zero Exception is Thrown when an exceptional arithmetic condition has occurred. The programs in the section illustrate IndexOutOfRange Exception and DivideByZero Exception. The C# programs in this section illustrate exception handling for Invalid TypeCasting in unBoxing and demonstrate exception handling for stack overflow. A NullReferenceException happens when you try to access a reference variable that isn’t referencing any object. The remaining programs in the section demonstrate multiple exceptions and illustrate NullRefernce Exception.