public void Add(Person person) { using (var context = new MyDBDataContext(_connectionString)) { context.Persons.InsertOnSubmit(person); context.SubmitChanges(); } }
public void EditPerson(Person person) { using (var context = new MyDBDataContext(_connectionString)) { context.Persons.Attach(person); context.Refresh(System.Data.Linq.RefreshMode.KeepCurrentValues, person); context.SubmitChanges(); } }