Bonjour
Je suis debutante en C# je suis entrain de realiser un projer gestion de relation client alors l'ajout d'un statut et la suppression ça passe trés bien sauf que la modification lors de la modification le hampq s'enrigistre vide dans la base de donnée voici le code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 public bool MAJ(int id) { DataBase bd = new DataBase(); Fonctions fonc = new Fonctions(); try { MySQLCommand cmd = new MySQLCommand("UPDATE Statut SET Intitule='"+_Intitule+"' WHERE NoStatut='"+id.ToString()+"'",bd.Connection()); MySQLDataReader reader = cmd.ExecuteReaderEx(); cmd.Dispose(); return true; } catch(Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); return false; } }
le code du boutton
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 void ModifierClick(object sender, EventArgs e) { MANBAT.CLASS.ClsStatut c=new MANBAT.CLASS.ClsStatut(); //MANBAT.FormStatutModif f=new MANBAT.FormStatutModif(_id); c.MAJ(_id); //f.textBox1=c.Intitule; }
Partager