Good evening, I research a lot on the net but I find not how used the parameter query to a database Access.in fact I create a connectionString and then I add this connection class
- class connexionGS
- {
- private OleDbConnection con = new OleDbConnection(Properties.Settings.Default.connectGS);
- private OleDbConnection getconnexion()
- {
-
-
- string constr = Properties.Settings.Default.connectGS;
- con=new OleDbConnection(constr);
- return con;
- }
-
- public static void ExcuteNonQuery(string requete)
- {
- connexionGS connect = new connexionGS();
- OleDbConnection con = connect.getconnexion();
- con.Open();
- OleDbCommand cmd = new OleDbCommand(requete, con);
- cmd.ExecuteNonQuery();
- cmd.Dispose();
- con.Close();
- }
-
- }
and then I add another class named product :
- public class Produit
- {
- public void AjouterProduit()
- {
- throw new NotImplementedException();
- }
-
- public void ModifierProduit()
- {
- throw new NotImplementedException();
- }
-
- public void SupprimerProduit()
- {
- throw new NotImplementedException();
- }
-
- public String referenceP;
- public String libelle;
- public DateTime dateProduction;
- public Double prix;
- public int qte;
-
- }
knowing that I use oledb.
can i find an example that uses the parameter query with the database access and OleDbConnection?