コード例 #1
0
 /// <summary>
 /// Output results through SqlProfiler class SqlCaptured event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void _profiler_SqlCaptured(object sender, SqlCapturedEventArgs e)
 {
     ColorPrompt("\n----- Event ID #£" + (++_numEvents).ToString(), ConsoleColor.Red);
     ColorPrompt(e.Text.Trim(), ConsoleColor.DarkYellow);
     ColorPrompt("----- Row count: £" + e.RowCount.ToString(), ConsoleColor.Red);
     ColorPrompt("----- Timestamp: £" + e.Time.ToString("yyyyMMddTHHmmss"), ConsoleColor.Red);
 }
コード例 #2
0
        protected void OnSqlCaptured(SqlCapturedEventArgs e)
        {
            var handler = SqlCaptured;

            if (handler != null)
            {
                handler(this, e);
            }
        }