Bonjour à tous !
J'essaye de tester les TransactionScope et j'ai une erreur que je n'arrive pas à régler...
Voici mon code :
Sur le premier d.ExecuteNonQuery(c), j'obtiens l'erreur suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 using (TransactionScope t = new TransactionScope()) { Database d = DatabaseFactory.CreateDatabase(); DbCommand c = d.GetSqlStringCommand("INSERT INTO privileges(alias) VALUES('plop')"); d.ExecuteNonQuery(c); DbCommand c2 = d.GetSqlStringCommand("INSERT INTO privileges(alias)VALUES('plop2')"); d.ExecuteNonQuery(c2); t.Complete(); }
Quelqu'un a une idée ?You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'XA BEGIN 'c02dab7b-d702-6454-b6be-33cfcec6a44e,-836f-6c9da2149e1a'' at line 1![]()
Partager