Bonjour,
J'ai besoin d'aide pour cette erreur:
syntaxe incorrect vers le mot clé 'user'
Le code suivant:
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
23
24
25
26
27
28
29
30
31
32
33
34
35
public  void Ajouter_Click(object sender, EventArgs e)
 
        {
               //on vérifi que tout les champs sont remplis
            if (this.idTextBox.Text == null || this.loginTextBox.Text == null || this.mpasseTextBox.Text == null || this.nomTextBox.Text == null || this.prenomTextBox.Text == null)
            {
                MessageBox.Show("Veuillez remplir tout les champs");
 
 
            }
            else
            {
 
 
                //source : livre introduction c# 2008 p 228
                string strConnexion = ConfigurationManager.ConnectionStrings["Pyramide.Properties.Settings.centreConnectionString"].ConnectionString;
 
                try
                {
                    SqlConnection oConnection = new SqlConnection(strConnexion);
 
                    oConnection.Open();
                    SqlCommand oCommand = oConnection.CreateCommand();
                    oCommand.CommandText = "INSERT INTO user(id_user,login_user, pass_user, nom_user, prenom_user) VALUES (" + this.idTextBox.Text + "," + this.loginTextBox.Text + "," + this.mpasseTextBox.Text + "," + this.nomTextBox.Text + "," + this.prenomTextBox.Text + "  )";
 
 
                    int nbligne = oCommand.ExecuteNonQuery();
                    MessageBox.Show("Ajout effectué avec succés");
                    oConnection.Close();
                }
                catch (Exception x)
                {
                    MessageBox.Show("L'erreur suivante a été rencontrée :" + x.Message);
 
                }
Merci de m'aider.