protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
private void ShowResult() { if (context != null) { context.Dispose(); context = new BankEntities(); } //step2 var q = from t in context.EmployeeInfo select t; //step 3 this.dataGrid.ItemsSource = q.ToList(); }
void DayQuery_Unloaded(object sender, RoutedEventArgs e) { context.Dispose(); }
void EmployeeBase_Unloaded(object sender, RoutedEventArgs e) { context.Dispose(); }
void ratePage_Unloaded(object sender, RoutedEventArgs e) { context.Dispose(); }
void ChangePay_Unloaded(object sender, RoutedEventArgs e) { context.Dispose(); }