Events indicating the activities performed by a given datasource.
Inheritance: System.EventArgs
Exemplo n.º 1
0
 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("");
 }
Exemplo n.º 2
0
 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("");
     }
 }
Exemplo n.º 3
0
        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("");
        }
Exemplo n.º 4
0
 static void DefaultDispatcher_ExecutionStarted(object sender, ExecutionEventArgs e)
 {
     Debug.WriteLine("******");
     Debug.WriteLine($"Execution started: {e.ExecutionDetails.OperationName}");
     WriteDetails(e);
 }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
 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("");
     }
 }
Exemplo n.º 8
0
 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("");
     }
 }