1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
string insertCritQry = "INSERT INTO dbtools.critere (LIBELLE, CODE, DESCRIPTION, TYPE_VAL) ValueS (?libelle, ?code, ?description, ?type_val);";
MySqlCommand cmdInsert = new MySqlCommand(insertCritQry, m_Connection);
cmdInsert.Parameters.Add("?libelle", MySqlDbType.VarChar, 100);
cmdInsert.Parameters.Add("?code", MySqlDbType.VarChar, 50);
cmdInsert.Parameters.Add("?description", MySqlDbType.Text);
cmdInsert.Parameters.Add("?type_val", MySqlDbType.Int32);
// compilation de la commande
cmdInsert.Prepare();
// initialisation paramètres
cmdInsert.Parameters["?libelle"].Value = curCrit.Libelle.ToString();
cmdInsert.Parameters["?code"].Value = curCrit.Code.ToString();
String desc = "-";
cmdInsert.Parameters["?description"].Value = desc;
cmdInsert.Parameters["?type_val"].Value = curCrit.m_TypeVal.GetHashCode(); |
Partager