Example #1
0
        private void Updatebtn_Click(object sender, RoutedEventArgs e)
        {
            int id = int.Parse(txtbox.Text);

            tbl = (from x in db.sampleTables
                   where x.id == id
                   select x).First();
            tbl.Name = TextBox.Text;
            db.SaveChanges();
            txtbox.Clear();
            TextBox.Clear();
        }
Example #2
0
        private void Deletebtn_Click(object sender, RoutedEventArgs e)
        {
            int id = int.Parse(txtbox.Text);

            tbl = (from x in db.sampleTables
                   where x.id == id
                   select x).First();
            db.sampleTables.Remove(tbl);
            db.SaveChanges();
            txtbox.Clear();
            TextBox.Clear();
            MessageBox.Show("Pomyślnie usunięto!");
        }