1 2 3 4 5 6 7 8 9 10 11
| // Au Moins pire :
string Select = String.Format("select repertoire from fichier where nom='{0}'", repertoire_a_supprime);
SqlCommand MyCmd = new SqlCommand(Select, Classe_methode_statique.con);
// etc ..
// (mais tu risque toujours une injection sql et des tas d'autres problèmes)
// Sinon ceci c'est Mieux
string Select = String.Format("select repertoire from fichier where nom=@RepSup";
SqlCommand MyCmd = new SqlCommand(Select, Classe_methode_statique.con);
MyCmd.Parameters.AddWithValue("@RepSup", repertoire_a_supprime); |
Partager