C# Questions and Answers

Write down the C# syntax to catch exception?

To catch an exception, we use try catch blocks. Catch block can have parameter of system.Exception type.

Eg:

try
{
GetAllData();
}
catch(Exception ex)
{
}