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()
- {
- //con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=../../gestion reglement.accdb;Persist Security Info=False;");
- //con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + AppDomain.CurrentDomain.GetData("DataDirectory") + "/gestion reglement.mdb;");
- 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();
- }
- }
- 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?

Chandu KumawatPosted Feb 27, 2016, 12:17 AM
Ranjit PowarPosted Feb 26, 2016, 9:22 PM