private void SomeControl_Click(object sender, EventArgs e) { db.SaveChanges(); db.Dispose(); entity = new My_Entities(); //more code using entity ... }
private void SomeControl_Click(object sender, EventArgs e) { db.SaveChanges(); db.Dispose(); db = new My_Entities();