private void Button_Click(object sender, RoutedEventArgs e) { Data1 n = new Data1 { kata = textBox1.Text }; db.mhs.InsertOnSubmit(n); db.SubmitChanges(); textBox1.Text = ""; RefreshData(); }
private void btn_del(object sender, RoutedEventArgs e) { using (Dcontext dd = new Dcontext("isostore:/Data.sdf")) { IQueryable <Data1> DQuery = from ddc in dd.mhs where ddc.kata == textBox1.Text select ddc; Data1 DRemove = DQuery.FirstOrDefault(); dd.mhs.DeleteOnSubmit(DRemove); dd.SubmitChanges(); } NavigationService.GoBack(); }