Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public static void Load()
  2. {
  3. string query = "*[System/Provider/@Name="SQLSERVERAGENT"]";
  4.  
  5. EventLogQuery elq = new EventLogQuery("Application", PathType.LogName, query);
  6. elq.Session = new EventLogSession("x.x.x.x");
  7. EventLogReader elr = new EventLogReader(elq);
  8.  
  9. _logEntries = new List<SqlEventEntry>();
  10.  
  11. EventRecord entry;
  12. while ((entry = elr.ReadEvent()) != null)
  13. {
  14. var Message = entry.???
  15. // I want process the message in the event here,
  16. // but I can't find a property anywhere that contains the message??
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement