1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
public int DBBInsertMain(DateTime Date, double Bid, double Ask, string NomEme)
{
if (db.getDbUp())
{
string strQuery = "INSERT INTO ma09 (DateRecep,Bid,Ask,NomEme) VALUES ( @DateRecep ," + Bid + "," + Ask + ",'" + NomEme + "');";
MySqlCommand oCommand = new MySqlCommand();
oCommand.CommandText = strQuery;
oCommand.Connection = db.getConnectionRessource();
oCommand.Parameters.Add("@DateRecep",MySqlDbType.DateTime);
oCommand.Parameters["@DateRecep"].Value = Date;
return oCommand.ExecuteNonQuery();
}
else
{
Console.WriteLine("Base non connectée.");
return 0;
}
} |
Partager