kabi14
Messages postés50Date d'inscriptionvendredi 8 avril 2011StatutMembreDernière intervention28 juin 2011
-
27 juin 2011 à 12:35
kabi14
Messages postés50Date d'inscriptionvendredi 8 avril 2011StatutMembreDernière intervention28 juin 2011
-
27 juin 2011 à 13:23
salut,
Je réalise une application (site web) sous visual studio 2010 avec une db mysql.
J'ai donc installé le connector 5.2 de mysql
Mais lors de insertion apartir d un formulaire ca marche pas
le code
MySqlDataAdapter apdat;
string p = TextBox10.Text;
string a= TextBox9.Text;
string c = TextBox8.Text;
DropDownList1.Items.Add(p);
string MyConString = "SERVER=localhost;" +
"DATABASE=t;" +
"UID=root;" +
"PASSWORD=;";
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
connection.Open();
command.CommandText = "insert into h values (\'" + p + "\',\'" + a + "\',\'" + c + "\') ";
apdat = command.ExecuteNonQuery();
je croie que l' erreur c est dans ExecuteQuery qui n execute pas l insertion dans la base de donner
merci