Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends!

I've an application which stores its values in EventLog files in Server..I can view those files using Gridview..

Now I have to clear(delete) them using CLEAR button..Is it possible? If so, how?


Plz reply asap..


Thanks & Regards,
Ravi kamesh..
Posted

You can try:
C#
if (System.Diagnostics.EventLog.Exists("MyCustomLog"))
{
    System.Diagnostics.EventLog.Delete("MyCustomLog");
}

Ref.:Delete Event Logs[^]

Have a look:
http://msdn.microsoft.com/en-us/library/y0fwyz5a(v=vs.71).aspx[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Jul-12 0:48am    
Ah, actually, this is a different thing I forgot about. My 5.
Teamwork! :-)
--SA
Prasad_Kulkarni 11-Jul-12 0:51am    
:D Thank you SA!
Manas Bhardwaj 11-Jul-12 5:57am    
Correct +5!
Prasad_Kulkarni 11-Jul-12 6:11am    
Thank you Manas!
V!jAy pAnT 11-Jul-12 6:26am    
hey can u tell me How to bind a gridview text box with outside text box using javascript....? plz its urgent help me...........thanx
What's wrong with System.Diagnostics.EventLog.Clear? Please see:
http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.clear.aspx[^]. :-)

—SA
 
Share this answer
 
Comments
Prasad_Kulkarni 11-Jul-12 0:41am    
Yes. A 5!
Sergey Alexandrovich Kryukov 11-Jul-12 0:45am    
Not too tricky, right? :-)
Thank you, Prasad.
--SA
Prasad_Kulkarni 11-Jul-12 0:52am    
Of course. Not too hard to get from google also.
Manas Bhardwaj 11-Jul-12 5:57am    
makes sense +5!
Sergey Alexandrovich Kryukov 11-Jul-12 10:32am    
Thank you, Manas.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900