System.OutOfMemory Exception

This exception handles errors that are generated due to insufficient free memory. Consider the above program to demonstrate System.OutOfMemoryException.

try { //user code which can throw OutOfMemoryException } catch(OutOfMemoryException exception) { //statements to handle the exception }

System.NullReferenc Exception

This exception handles errors that are generated from referencing a null object. Consider the above program to demonstrate System.NullReferenceException.

try { //user code which can throw NullReferenceException } catch(NullReferenceException exception) { //statements to handle the exception }

System.InvalidCast Exception

This exception handles errors that are generated during typecasting. Consider the above program to demonstrate System.InvalidCastException.

try { //user code which can throw InvalidCastException } catch(InvalidCastException exception) { //statements to handle the exception }

System.ArrayTyp MismatchException

This exception handles errors that are generated when there is a mismatch of type with the array type. Consider the above syntax to demonstrate System.ArrayTypeMismatchException.

try { //user code which can throw ArrayTypeMismatchException } catch(ArrayTypeMismatchException exception) { //statements to handle the exception }

System.IndexOutRange Exception

This exception handles errors that are generated when a method is referring to an array that is out of range. Consider the above syntax to demonstrate System.IndexOutOfRangeException.

try { //user code which can throw IndexOutOfRangeException } catch(IndexOutOfRangeException exception) { //statements to handle the exception }

System.DivideByZero Exception

This exception handles errors that are generated when a dividend is divided by zero. Consider the above syntax to demonstrate System.DivideByZeroException.

try { //user code which can throw DivideByZeroException } catch(DivideByZeroException exception) { //statements to handle the exception }

System.StackOverflow Exception

This exception handles errors that are generated from stack overflowing. Consider the above syntax to demonstrate System.StackOverflowException.

try { //user code which can throw StackOverflowException } catch(StackOverflowException exception) { //statements to handle the exception }

System.IO.IOException

This exception handles the errors generated by the input and output. Consider the above syntax to demonstrate System.IO.IOException.

try { //user code which can throw System.IO.IOException } catch(System.IO.IOException exception) { //statements to handle the exception }

2X faster apps development ! 

Syncfusion offers over 1,800 components and frameworks for WinForms, WPF, ASP.NET (MVC, Core), UWP, WinUI, .NET MAUI, Xamarin, Flutter, Blazor, JavaScript, Angular, Vue, and React that make developers’ work easier.