Hi,
I'm trying to execute a distributed transaction using the following code:
Imports System.Data.SqlClient
Imports System.EnterpriseServices
Imports System.Runtime.InteropServices
<Transaction(TransactionOption.Required), _
ClassInterface(ClassInterfaceType.None)> _
Public Class SimpleServicedComponent
Inherits ServicedComponent
Public Function TestServersConnection() As String
Dim transaction As ITransaction
transaction = ContextUtil.Transaction
Dim strDBConn2 As String
Dim sqlConn2 As New SqlConnection
Dim sqlCMD2 As New SqlCommand
Dim blnRes2 As Boolean
strDBConn2 =
"server=itsrv2;uid=sa;pwd=sasa;database=DB;Enlist=false"
sqlConn2.ConnectionString = strDBConn2
sqlCMD2.CommandType = CommandType.Text
sqlCMD2.CommandText = ("update accounts set balance = 10 ")
sqlCMD2.Connection = sqlConn2
sqlConn2.Open()
sqlConn2.EnlistDistributedTransaction(transaction)
Try
blnRes2 = sqlCMD2.ExecuteNonQuery
If blnRes2 Then
ContextUtil.SetComplete()
Else
ContextUtil.SetAbort()
End If
Catch e As SqlException
Throw e
Finally
sqlConn1.Close()
End Try
End Function
End Class
The following error is generated at run time:
"An error occurred while enlisting in a distributed transaction."
I really need help on this ASAP. Your help is highly appreciated.
Regards,
Hadeel
Tasos Vogiatzoglou - 12 Jul 2006 11:14 GMT
Is there a firewall preventing MSDTC from working ?
What are the security/authentication options of MSDTC ?
Are you able to perform distributed transactions ?
Regards,
Tasos
PS: Please don't cross-post
> Hi,
>
[quoted text clipped - 80 lines]
>
> Hadeel
Hadeel - 12 Jul 2006 14:06 GMT
> Hi,
>
[quoted text clipped - 80 lines]
>
> Hadeel