c# - general sql exception logging -


i have class things related sql handled called sql helper. want achieve , catch exceptions occer particular class , log them.since class called several places , has more 25-30 methods in it. find tedious go each , every method write exception handling.

this windows application there better way handle this. eg way have in asp.net

application_error()  {   } 

use:

appdomain currentdomain = appdomain.currentdomain; currentdomain.unhandledexception += new unhandledexceptioneventhandler(myexceptionhandler); 

http://msdn.microsoft.com/es-es/library/system.appdomain.unhandledexception.aspx


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -