Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / July 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hadeel - 11 Jul 2006 14:02 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.