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类?