private void btnDelKat_Click(object sender, EventArgs e)
 {
     if (cbKategorie.SelectedIndex != -1)
     {
         Kategorie k = new Kategorie(liKategorie[cbKategorie.SelectedIndex].KatNr1,
                                     liKategorie[cbKategorie.SelectedIndex].KatBezeichnung1);
         db.DeleteKategorie(k);
         cbKategorie.Text = "";
         FillUpKategorie();
     }
 }
Exemple #2
0
 public void DeleteKategorie(Kategorie k)
 {
     try
     {
         MySqlCommand comm = con.CreateCommand();
         comm.CommandText = "DELETE FROM kategorie WHERE KatNr = " + k.KatNr1.ToString() + ";";
         comm.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show("DeleteSpiese: " + ex);
     }
 }