public static void WriteToDB(DasDBDataContext db, Exception ex)
        {
            try
            {
                var log = new LogEntry();
                log.Date = DateTime.Now.ToLocalTime();
                log.IsError = true;
                log.Message = ex.ToString();

                db.LogEntries.InsertOnSubmit(log);
                db.SubmitChanges();

            }
            catch (Exception)
            {
                throw;
                // Game over
            }
        }
 partial void DeleteLogEntry(LogEntry instance);
 partial void UpdateLogEntry(LogEntry instance);
 partial void InsertLogEntry(LogEntry instance);