HighTechTalks DotNet Forums  

Re: "An error occurred while enlisting in a distributed transaction."

Dotnet Distributed Applications microsoft.public.dotnet.distributed_apps


Discuss Re: "An error occurred while enlisting in a distributed transaction." in the Dotnet Distributed Applications forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Tasos Vogiatzoglou
 
Posts: n/a

Default Re: "An error occurred while enlisting in a distributed transaction." - 07-12-2006 , 06:14 AM






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

Hadeel wrote:
Quote:
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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.