public void AddException(Guid sourceID, Exception error)
{
if (error != null)
{
lock (lockingObject2)
{
using (SqlCommand cmd =
new SqlCommand("INSERT INTO Exceptions (SourceID, Message, StackTrace, ExceptionType) "
+ "VALUES (@SourceID, @Message, @StackTrace, @ExceptionType);",
ActiveConnection))
{
cmd.Parameters.AddWithValue("@SourceID", sourceID.ToString());
cmd.Parameters.AddWithValue("@Message", error.Message);
cmd.Parameters.AddWithValue("@StackTrace", error.StackTrace);
cmd.Parameters.AddWithValue("@ExceptionType", error.GetType().ToString());
cmd.ExecuteNonQuery();
}
}
}
}
SqlConnection GetConnection()