Monday, February 18, 2008

Writing the Error or any log message to Event log of the OS

string sSource, sLog, sEvent;
sSource = "Error Occur While Inserting Employee Record";
sLog = "Application";
sEvent = "Insert";

if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource,sLog);
EventLog.WriteEntry(sSource,sEvent);

2 comments:

Anonymous said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Câmera Digital, I hope you enjoy. The address is http://camera-fotografica-digital.blogspot.com. A hug.

Prabakar said...

Thanks Digital ...
ya sure i will see that