public string InsertAlerte(BDDAlerte alerte) { MySqlConnection conn = DBConf.GetDBConnection(); try { conn.Open(); MySqlCommand command = conn.CreateCommand(); command.CommandText = "INSERT INTO alerte (alerte) VALUES (@alerte)"; command.Parameters.AddWithValue("alerte", alerte.alerte); command.ExecuteNonQuery(); return("Success !"); } catch (Exception e) { return(e.ToString()); throw; } finally { conn.Close(); conn.Dispose(); conn = null; } }
public string InsertAlerte(BDDAlerte bddalerte) { BDDAlerte alerte = new BDDAlerte(); return(alerte.InsertAlerte(bddalerte)); }