I want to write some try and catch that catch any type or exception
try {
code....
}
catch (Exception ex){}
Or should it be
try {
code....
}
catch {}
?
Home / DeveloperSection / Forums / How to catch all exceptions in c# using try and catch?
Pravesh Singh
24-Sep-2013Both ways are correct If you need to do something with Exception object in catch block than you should use
and than use ex in catch block.