TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
abdelwaheb ammar
1.3k
457
124.6k
parameterized query with Access database
Feb 26 2016 6:40 PM
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();
}
}
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?
Reply
Answers (
2
)
selecting multiple rows in datagridview by checkbox
convert fro datagridview to excel without for loop