daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Feb 21st, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top