用oledb连接dbf文件,无法回滚
在vs中使用oledb连接dbf文件,使用oledb的Transaction物件,执行rollback时却无法回滚,请问是什么原因?代码如下:
--------------------------------------------------------------------------
OleDbConnection connection=new OleDbConnection(@"provider=vfpoledb;data source=xxxxxx")
connection.Open();
using (OleDbTransaction tran = connection.BeginTransaction())
{
OleDbCommand cmd = new OleDbCommand("Insert Into TestTable(mremark) values('XXXX')", connection);
cmd.Transaction = tran;
int result = cmd.ExecuteNonQuery();
int a = 0;
int b = 1 / a;
();
}
-------------------------------------------------------------------------------
代码中在事务Commit前故意出错,却发现没回滚。