Click here to Skip to main content
15,904,153 members

Comments by zutt (Top 5 by date)

zutt 17-Dec-19 9:59am View    
Oh sorry i didn't see
zutt 17-Dec-19 9:57am View    
Sorry I believed I asked the author ^^'
https://www.codeproject.com/articles/43438/connect-c-to-mysql
zutt 17-Dec-19 9:46am View    
Deleted
Here is my UnitTest (the name of address at the start is test) :

using (MySqlConnection db = new MySqlConnection(connectionString))
{
MySqlTransaction transaction;

db.Open();
transaction = db.BeginTransaction();

new MySqlCommand("UPDATE t_adresse SET `nomAdresse`='forbl' WHERE idAdresse=8;",db, transaction).ExecuteNonQuery();

transaction.Rollback();

MySqlCommand cmdUpdateAdresse = new MySqlCommand("SELECT nomAdresse FROM t_adresse WHERE idAdresse=8", db);
MySqlDataReader data = cmdUpdateAdresse.ExecuteReader();
while (data.Read())
{
Assert.AreEqual("test", (string)data["nomAdresse"]);
}
db.Close();
}

And the test return that the value expected (test) doesn't match the actual value (forbl)
zutt 17-Dec-19 9:36am View    
I know but to post some code I cannot do differently
zutt 17-Dec-19 8:21am View    
I want to Rollback the UPDATE but its apply the change