static void WriteDetails(ExecutionEventArgs e) { Debug.WriteLine(""); Debug.WriteLine("Command text: "); Debug.WriteLine(e.ExecutionDetails.CommandText); Debug.Indent(); foreach (var item in ((SqlServerCommandExecutionToken)e.ExecutionDetails).Parameters) Debug.WriteLine(item.ParameterName + ": " + (item.Value == null || item.Value == DBNull.Value ? "<NULL>" : item.Value)); Debug.Unindent(); Debug.WriteLine("******"); Debug.WriteLine(""); }
void WriteDetails(ExecutionEventArgs e) { if (e.ExecutionDetails is SQLiteCommandExecutionToken) { WriteLine(""); WriteLine("Command text: "); WriteLine(e.ExecutionDetails.CommandText); //m_Output.Indent(); foreach (var item in ((SQLiteCommandExecutionToken)e.ExecutionDetails).Parameters) WriteLine(item.ParameterName + ": " + (item.Value == null || item.Value == DBNull.Value ? "<NULL>" : item.Value)); //m_Output.Unindent(); WriteLine("******"); WriteLine(""); } }
void WriteDetails(ExecutionEventArgs e) { var token = e.ExecutionDetails as AccessCommandExecutionToken; if (token == null) return; WriteLine(""); WriteLine("Command text: "); WriteLine(e.ExecutionDetails.CommandText); //m_Output.Indent(); if (token.Parameters != null) foreach (var item in token.Parameters) WriteLine(item.ParameterName + ": " + (item.Value == null || item.Value == DBNull.Value ? "<NULL>" : item.Value)); //m_Output.Unindent(); WriteLine("******"); WriteLine(""); }
static void DefaultDispatcher_ExecutionStarted(object sender, ExecutionEventArgs e) { Debug.WriteLine("******"); Debug.WriteLine($"Execution started: {e.ExecutionDetails.OperationName}"); WriteDetails(e); }
static void DefaultDispatcher_ExecutionFinished(object sender, ExecutionEventArgs e) { Debug.WriteLine("******"); Debug.WriteLine($"Execution finished: {e.ExecutionDetails.OperationName}. Duration: {e.Duration.Value.TotalSeconds.ToString("N3")} sec. Rows affected: {(e.RowsAffected != null ? e.RowsAffected.Value.ToString("N0") : "<NULL>")}."); //WriteDetails(e); }
static void DefaultDispatcher_ExecutionError(object sender, ExecutionEventArgs e) { Debug.WriteLine("******"); Debug.WriteLine($"Execution error: {e.ExecutionDetails.OperationName}. Duration: {e.Duration.Value.TotalSeconds.ToString("N3")} sec."); //WriteDetails(e); }
void WriteDetails(ExecutionEventArgs e) { if (e.ExecutionDetails is PostgreSqlCommandExecutionToken) { WriteLine(""); WriteLine("Command text: "); WriteLine(e.ExecutionDetails.CommandText); WriteLine("CommandType: " + e.ExecutionDetails.CommandType); //Indent(); foreach (var item in ((PostgreSqlCommandExecutionToken)e.ExecutionDetails).Parameters) WriteLine(item.ParameterName + ": " + (item.Value == null || item.Value == DBNull.Value ? "<NULL>" : item.Value)); //Unindent(); WriteLine("******"); WriteLine(""); } }
void WriteDetails(ExecutionEventArgs e) { if (e.ExecutionDetails is SqlServerCommandExecutionToken) { WriteLine(""); WriteLine("Command text: "); WriteLine(e.ExecutionDetails.CommandText); //Indent(); foreach (var item in ((SqlServerCommandExecutionToken)e.ExecutionDetails).Parameters) WriteLine(item.ParameterName + ": " + (item.Value == null || item.Value == DBNull.Value ? "<NULL>" : item.Value) + " [" + item.SqlDbType + "]"); //Unindent(); WriteLine("******"); WriteLine(""); } }