Exemplo n.º 1
0
 public void HapusGaya(Gaya gayaHapus)
 {
     try {
         connection.Open();
         string       query   = string.Format("delete from `gaya` where id_gaya={0}", gayaHapus.IdGaya);
         MySqlCommand command = new MySqlCommand(query, connection);
         command.ExecuteNonQuery();
         connection.Close();
     } catch (Exception e) {
         MessageBox.Show("Error Deleting Gaya Renang!\nKeterangan :" + e.Message);
     }
 }
Exemplo n.º 2
0
 public void InsertGaya(Gaya gayaInput)
 {
     try {
         connection.Open();
         string       query   = string.Format("insert into `gaya`(nama_gaya) values('{0}')", gayaInput.NamaGaya);
         MySqlCommand command = new MySqlCommand(query, connection);
         command.ExecuteNonQuery();
         connection.Close();
     } catch (Exception e) {
         MessageBox.Show("Error Inserting Gaya Renang!\nKeterangan :" + e.Message);
     }
 }