我的DataAccessLayer事务的用法.
IDal dal = DBFactory.GetDBO(..);
dal.Open();
try
{
dal.BeginTrans();
dal.ExecuteNoneQuery(cmd);
dal.CommitTrans();
}
catch
{
dal.RollBackTrans();
}
finally
{
dal.Close();
}
dal.Open();
try
{
dal.BeginTrans();
dal.ExecuteNoneQuery(cmd);
dal.CommitTrans();
}
catch
{
dal.RollBackTrans();
}
finally
{
dal.Close();
}
posted on 2004-08-13 18:49 HelloSnoopy 阅读(418) 评论(0) 编辑 收藏 举报