Bonjour

En fait j'ai une winform et j'aimerai inserer des donnees dans ma base
j'utilise le mode deconnecté je vous montre mon code la precision la partie SELECT marche bien c'est l'INSERT qui ne marche pas

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
 
 
 private void button_ajouter_Click(object sender, EventArgs e)
        {
            //on va utiliser un Insert
            myDa.InsertCommand = new SqlCommand();
            myDa.InsertCommand.Connection = connection;
            myDa.InsertCommand.CommandText = "INSERT INTO T_AVION(AV_MODELE, AV_CONSTRUCTEUR) VALUES('" + txt_model + "','" + txt_construc + "')";
 
 
            myDa.Update(myDs, "T_AVION");
            dataGridView1.DataSource =myDs.Tables["T_AVION"];
 
 
 
 
private void button_affichage_Click(object sender, EventArgs e)
        {
            //on va utiliser la fonction select
            myDa.SelectCommand = new SqlCommand();
            myDa.SelectCommand.Connection = connection;
            myDa.SelectCommand.CommandText = "SELECT * FROM T_AVION";
 
            myDa.Fill(myDs, "T_AVION");
            dataGridView1.DataSource = myDs.Tables["T_AVION"];
 
        }
 
Si quelqu'un à une idee merci