Requette d'insertion de pilote odbc

Résolu
7amdaoui Messages postés 12 Date d'inscription vendredi 9 mars 2007 Statut Membre Dernière intervention 23 avril 2008 - 22 mai 2007 à 15:44
7amdaoui Messages postés 12 Date d'inscription vendredi 9 mars 2007 Statut Membre Dernière intervention 23 avril 2008 - 22 mai 2007 à 17:35
Slt tous le monde..
lors de l'excution de ce code une exception apparaisse
nom de colone n'est pas autorise ici 

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim com2 As New Odbc.OdbcCommand
        Dim con As New Odbc.OdbcConnection 'Objet qui définit la connexion
        Dim i As Integer
        con.ConnectionString = "Dsn=asma;uid=khalil;server=PFE;pwd=roma"
        con.Open()
        com2.Connection = con
        com2.CommandText = "INSERT INTO METHODOLOGIE(IDMETHOD, NOM, DESCRIPTION ) VALUES(" & Integer.Parse(TextBox1.Text) & "," & TextBox2.Text & "," & TextBox3.Text & ")"
        i = com2.ExecuteNonQuery()




    End Sub

2 réponses

cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 15
22 mai 2007 à 16:56
Salut,

Essaye comme cela :

com2.CommandText = "INSERT INTO METHODOLOGIE(IDMETHOD, NOM, DESCRIPTION ) VALUES( '" & Integer.Parse(TextBox1.Text) & "' , '" & TextBox2.Text & "', '" & TextBox3.Text & "')"

A+
Exploreur

 Linux a un noyau, Windows un pépin

 
3
7amdaoui Messages postés 12 Date d'inscription vendredi 9 mars 2007 Statut Membre Dernière intervention 23 avril 2008
22 mai 2007 à 17:35
Merci pour votre coopération.....c vrai... 
0
Rejoignez-nous