public int ClearOldEvents() { // deactivate any events in the past. int rows = 0; int today = DateTime.Today.Day; // current day int month = DateTime.Today.Month; // current month int year = DateTime.Today.Year; // current year // format it for Sql string currentDate = month + "-" + today + "-" + year; try { EventAccessor.DeactivateOldEvents(currentDate); } catch (Exception) { throw; } return(rows); }