Bonjour!
Je suis en train de concevoir une application de gestion du personnel

j'utilise une base de données access que j'ai importé sur visual c#

dans cette base j'ai la table Agent qui est en relation avec table service

j'ai crée un form qui contient à la fois les champs de la table Agent et Service

j'ai crée un bouton save pour enregistrer avec code mais je reçois l'erruer suivante:

ErreurSystem.Data.OleDbException: "Erreur de syntaxe dans l'instruction Insert into"

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
try
            {
                connection.Open();
                OleDbCommand command = new OleDbCommand();
 
                command.Connection = connection;
 
                command.CommandText ="Insert into AGENT(Matricule,Nom_Prénom,Date_naiss,Lieu_naiss,Age,Sexe,Situation_matrimon,Type_agent,Corps,Cadre,CATEGORIE,Grade,Echelon,Adresse,Personne_à_contacter) values('" + textBox1.Text + "','" + textBox2.Text + "','" + dateTimePicker1.Value + "','" + textBox8.Text + "','" + textBox5.Text + "','" + comboBox1.SelectedValue + "','" + comboBox2.SelectedValue + "','" + comboBox3.SelectedValue + "','" + textBox3.Text + "','" + textBox6.Text + "','" + comboBox4.SelectedValue + "','" + comboBox5.SelectedValue + "','" + comboBox6.SelectedValue + "','" + textBox4.Text + "','" + textBox7.Text + "');";
 
                command.CommandText = "insert into SERVICE(Direction,Service,Fonction,Date affectation) values('" + textBox9.Text + "','" + textBox10.Text + "','" + textBox11.Text + "','" + textBox12.Text + "')";
                command.ExecuteNonQuery();       
 
                MessageBox.Show("Data Saved");
 
                connection.Close();
            }
 
            catch (Exception ex)
            {
                MessageBox.Show("Erreur" + ex);
            }
        }
SVP quelqu'un peut il m'aider
Merci!