Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / September 2007



Tip: Looking for answers? Try searching our database.

Visual Studio Error R6034 when using Transaction Scope with File System and MySQL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe - 29 Sep 2007 18:31 GMT
Very weird; I lost a day worth of work because of this problem.
I have an ASP.NET application written in VB that is using MySQL
database. Shortly, a page creates a Customer record in the database
and if successful, creates a directory on the web server. I was using
Transaction Scope to accomplish this action; here is the code excerpt:

           ' Initialize the return value to zero
           Dim returnValue As Integer = 0

           ' Create a command string
           Dim sSQLCommand As String

           Try

               Using scope As New TransactionScope()

                   Using connection1 As New
MySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("mysqlConnString").ConnectionString)

                       Try

                           ' Build a query to execute
                           sSQLCommand = "DELETE FROM Customers WHERE
CustomerID = '" &
Me.gvCustomers.SelectedRow.Cells(eCUSTOMERSCOLUMNS.CustomerID).Text &
"' "

                           ' Opening the connection automatically
enlists it in the
                           ' TransactionScope as a lightweight
transaction.
                           connection1.Open()

                           ' Create the MySqlCommand object and
execute the first command.
                           Dim command1 As MySqlCommand = New
MySqlCommand(sSQLCommand, connection1)
                           returnValue = command1.ExecuteNonQuery()

                           ' Delete directory

System.IO.Directory.Delete(Me.gvCustomers.SelectedRow.Cells(eCUSTOMERSCOLUMNS.DirectoryPhysicalPath).Text,
True)

                       Catch ex As Exception
                           ' Log error here
                           Throw New Exception("Error", ex)
                       End Try

                   End Using

                   ' Success, empty the session variables
                   Session("selectedcustomerid") = String.Empty
                   Session("selectedcustomername") = String.Empty

                   ' The Complete method commits the transaction. If
an exception has been thrown,
                   ' Complete is called and the transaction is rolled
back.
                   scope.Complete()

               End Using

           Catch ex As Exception
               ' Log error here
           End Try

I have checked the grid value for the DELETE statement and both path
and CustomerID were correct.
And one more thing; my web project was located on the external hard
drive.
What happened here is that I end up in the first Catch block with the
timeout and then I stopped the application. Then I got a weird
manifest error and a message to close VS because it is in 'unstable
state'. After I restarted VS, I get Error R6034 and after research, I
saw that most of my C:\Program Files\Microsoft Visual Studio 8 is
gone!!!

And a day later, I am running it again after I had to reinstall both
Visual Studio 2005 and SQL Server 2005 that was also installed on my
machine.

Anybody experienced anything similar to this and does anybody (maybe
Microsoft folks) have a possible explanation for this issue?

Thanks in advance,
Joe
Ralph - 29 Sep 2007 19:08 GMT
> Very weird; I lost a day worth of work because of this problem.
> I have an ASP.NET application  ....
<snipped>

Wrong version of VB. Wrong newsgroup.

You can find a complete list of managed (dotNet) newsgroups here:
http://msdn.microsoft.com/subscriptions/managednewsgroups/list.aspx

-ralph
 
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



©2009 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.