Exemple #1
0
 public void setTypeSport(TypeClub Type)
 {
     using (MySqlConnection connection = new MySqlConnection(connectionString))
     {
         connection.Open();
         MySqlCommand command = connection.CreateCommand();
         command.CommandText = "INSERT INTO type(Libelle) VALUES (@Libelle)";
         command.Parameters.AddWithValue("@Libelle", Type.getLibelle());
         command.ExecuteNonQuery();
         connection.Close();
     }
 }
Exemple #2
0
        public void supTypeSport(TypeClub type)
        {
            using (MySqlConnection connection = new MySqlConnection(connectionString))
            {
                connection.Open();
                string query = "DELETE FROM type WHERE Libelle=@Libelle";

                //on crée la commande
                MySqlCommand command = new MySqlCommand(query, connection);

                command.Parameters.AddWithValue("@Libelle", type.getLibelle());
                command.ExecuteNonQuery();

                connection.Close();
            }
        }