Wednesday 23 December 2015

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) { } try { GetAllData(); } catch(Exception ex) { } In the above example, we can omit the parameter from catch statement.

No comments:

Post a Comment