public bool DeleteEvent(int eventID) { using (LinqLibraryDataContext dataContext = new LinqLibraryDataContext()) { Event gotIt = null; foreach (Event e in dataContext.GetAllEvents()) { if (e.event_ID == eventID) { gotIt = e; } } if (gotIt != null) { dataContext.DeleteEvent(eventID); return(true); } return(false); } }