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