.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

exception handling in c#.net?

Posted By: naresh reddy     Posted Date: March 05, 2010    Points:2   Category :C#
give brief and easy introduction about exception handling in c#.net?

Author: Syed Shakeer Hussain             
Posted Date: March 05, 2010     Points: 5   

Hi Naresh,
check the below link,you will learn very easily with good examples


Author: Kunal Chowdhury             
Posted Date: March 05, 2010     Points: 5   


Some of the tips I will add here is:

- Catch only the exceptions which you can handle
- Catch the exact exception rather than catching the generic exception
- Catch exception one by one in priority order & if you think there might be any other exception then only use the generic block
- Never put unnecessary Try{} Catch{} block, it requires more processing power
- If you are creating some resource, use Finally{} block to release all the resources

Author: abhay             
Posted Date: March 08, 2010     Points: 5   

///your code

catch(Exception ex)

//you can add finally block here

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend