Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6656157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:36:31+00:00 2026-05-26T01:36:31+00:00

I have a process that requires a rollback of all updates and inserts should

  • 0

I have a process that requires a rollback of all updates and inserts should there be an error during any phase. So i wanted to use the TransactionScope class to accomplish this. Here is my code:

using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
{
    IWE dbContext1 = null;

    using (dbContext1 = new IWE())
    {
        dbContext1.Connection.Open();

        //make some changes using the dbContext1

        //Save Changes but don't discard yet
        dbContext1.SaveChanges(false);

       //make a call to another database
       using (EPE context = new EPE())
       {

          //add or makes some changes
          context.SaveChanges(false);
       }
    }


    //if there were no problems above committ the transaction
    if (success)
    {
         ////if we get here things are looking good.
         scope.Complete();

         //accept the changes above against these connections.
         dbContext1.AcceptAllChanges();
    }
}

Problem is as soon as i make the call to the second connection i get the error:

“Network access for Distributed Transaction Manager (MSDTC) has been
disabled. Please enable DTC for network access in the security
configuration for MSDTC using the Component Services Administrative
tool.”

I have checked to make sure that the MSDTC is enabled on both servers. Or at least it appears so.

Other information:
– There is no firewall between them.
– First DB server is running Windows Server 2003 R2 w/ sql 2005
– Second DB server is running Windows Server 2003 w/ sql 2000

Can anyone point me in the right direction using the transaction scope w/ or w/o the use of distributed transactions?

Thanks in advance,
Billy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:36:31+00:00Added an answer on May 26, 2026 at 1:36 am

    I ended up going about this a different way after alot of time spent trying to get the Distributed transactions to work.

    My solution was to just use a single connection. So I created a view on the first DB that mapped to the database table on the second DB(different server as well) that i needed to insert into. I imported that view into my entity model as well as all three stored procedure cud statements(only using insert but need all of them) and mapped them to the entity object accordingly.

    After that everything work as it should under one single connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a process that imports a lot of data (950k rows) using inserts
I have a button that will launch a process that requires UAC elevation. I
I have an ASP.NET page that requires data from another DLL and the process
We have a rule in TFS that requires all checkins to be associated with
I have a project that requires the process of order entry. An order will
I have a program that requires much memory, like 2/3 of all the physical
I have an internal process that requires data in a very specific format. Nothing
I have my OAuth process working well, I have an application that requires Google
I have a project that requires me to process a lot (1000-10000) of big
I have Process objects that are monitored from two different views. A Windows.Forms.ListView (actually

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.