2
我正在爲應用事務提交和回滾的webmatrix項目編寫代碼。 我使用mysql 5.1和innodb數據庫引擎進行事務支持。如何在Webmatrix.Data.Database中創建事務提交和回滾
我用
db.Connection.BeginTransaction();
try
{
db.Execute("Insert into tmp_upload_img(`path`,`type`) values(@0)", FullPath,"Fullimage");
db.Execute("Insert into tmp_upload_img(`path`,`type`) values(@0)", ThumbPath, "Thumbimage");
db.Execute("Insert into tmp_upload_img(`path`,`type`) values(@0)", SmallPath, "Smallimage");
db.Connection.BeginTransaction().Commit();
}
catch
{
db.Connection.BeginTransaction().Rollback();
}
,可是我不實現WebMatrix的項目事務支持。
我知道這可以mysql.data.mysqlclient實現,但我想知道這是可能的webmatrix.data類?