I am trying to define a simple transaction at page level but it is
failling. I have added a reference to System.EnterpriseServices and on the page I have set these directives:

<%@ Page Language="vb" Transaction="Required" ... %>
<%@ Assembly Name="System.EnterpriseServices.dll" %>
<%@ Import Namespace="System.EnterpriseServices" %>

In a button, on the code-behind module I have:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cn As OleDbConnection
Dim cm As OleDbCommand

Try

'open connection here

cm = New OleDbCommand()
With cm
.Connection = cn
.CommandType = CommandType.Text
.CommandText = "INSERT INTO tb_ccg(id_ccg, num_ccg)
VALUES (1, '21')"
.ExecuteNonQuery()

'Table name is wrong
.CommandText = "INSERT INTO tb_ccgss(id_ccg, num_ccg) VALUES (2,'32')"
.ExecuteNonQuery()
End With
ContextUtil.SetComplete()

Catch Ex As Exception
ContextUtil.SetAbort()

Finally
cn.Close()
End Try

On the second command, the table name is wrong, so I need that all the commands be aborted. But the first command is executed while the second is not. Am I missing something?

Thanks,

Robert