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
Post a Comment