private void UpStation_Load(object sender, EventArgs e) { hrc = new HRContactsEntities(); var stx = from item in hrc.Stations where item.S_oper == MyParentForm.oper select item; bSrc.DataSource = stx.ToList(); bNav.BindingSource = bSrc; bNav.Visible = true; dgvUp.DataSource = bSrc; } // end of method private void loadBindingNavigatorSaveItem_Click(object sender, EventArgs e) { Validate(); bSrc.EndEdit(); try { hrc.SaveChanges(); } catch (System.Data.Entity.Validation.DbEntityValidationException ex) { foreach (var eve in ex.EntityValidationErrors) { Debug.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Debug.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } throw; } } // end of method
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)