Ora-01036 illegal variable name/number

Fermé
sad55Mauvyche Messages postés 7 Date d'inscription lundi 21 octobre 2013 Statut Membre Dernière intervention 14 mars 2014 - 10 mars 2014 à 12:11
chico200987 Messages postés 791 Date d'inscription mardi 6 avril 2004 Statut Membre Dernière intervention 30 juillet 2018 - 10 mars 2014 à 14:11
Bonjour,
Je suis entrain de développez un programme et je rencontre ce problème lors de création d'un requête d'ajout.l'ajout marche si le code est statique.

Code c# :



public void Enregistrer()
{
try
{
OracleConnection connection = Connexion.connecter();
OracleCommand command = new OracleCommand();
string requete = "INSERT INTO GESCMS_PAL.CATEGORIE (ID_CATEGORIE,LIBELLE,DESCRIPTION) VALUES(@id_categorie,@libelle,@description)";
command.Connection = connection;
command.CommandText = requete;
command.Prepare();
command.Parameters.AddWithValue("@id_categorie", this.id_categorie);
command.Parameters.AddWithValue("@libelle", this.libelle);
command.Parameters.AddWithValue("@description", this.description);
command.ExecuteNonQuery();
MessageBox.Show("Enregistrement effectué avec Succès");
connection.Close();
}
catch (OracleException ex)
{
MessageBox.Show("erreur:"+ex.ToString());
}
}

1 réponse

chico200987 Messages postés 791 Date d'inscription mardi 6 avril 2004 Statut Membre Dernière intervention 30 juillet 2018 144
10 mars 2014 à 14:11
Salut,

As-tu pense a verifier ce que valent tes variables this.id_categorie, this.libelle et this.description avant l'execution de la requete ?

0