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 8449287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:39:35+00:00 2026-06-10T10:39:35+00:00

I am using Entity Framework 5 and need to make multiple stored procedure calls

  • 0

I am using Entity Framework 5 and need to make multiple stored procedure calls in a single transaction. They are all inserts where each depends on an output of the previous one and I want to be able to roll everything back in case one fails. Each call uses the same Entities object. The first call executes successfully, but the next one always fails with the following error:

“The underlying provider failed on Open.”

Inner exception: “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.”

Inner Inner exception: “The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)”

Is there a way to do this without going down the DTC road?

Code:

ObjectParameter outputParam1 = new ObjectParameter("newEntity1", 0);
ObjectParameter outputParam2 = new ObjectParameter("newEntity2", 0);

using (var scope = new TransactionScope())
{
    try
    {
        using(var context = new DatabaseContext())
        {
            context.f_createEntity1(outputParam1);
        }

        using(var context = new DatabaseContext())
        {
            context.f_createEntity2(ouputParam2, outputParam1.Value);
        }

        ... other calls ...

        scope.Complete();
    }
    catch (Exception ex)
    {
        ... handle error ...
    }
}
  • 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-06-10T10:39:37+00:00Added an answer on June 10, 2026 at 10:39 am

    There’s not a way to do this without having the DTC enabled.

    From a related SO post:

    At least two durable resources that support single-phase notifications
    are enlisted in the transaction. For example, enlisting a single
    connection with does not cause a transaction to be promoted. However,
    whenever you open a second connection to a database causing the
    database to enlist, the System.Transactions infrastructure detects
    that it is the second durable resource in the transaction, and
    escalates it to an MSDTC transaction.

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

Sidebar

Related Questions

How would I write a query using entity framework where I need to make
So, I'm using Entity Framework and need to now how set my own primary
I'm using Entity Framework 4.3.1 Code-First and I need to split an entity between
We are using Entity Framework 1.0. In some cases we need to explicitly open
I am using Entity Framework, C# 4.0 and Visual Studio 2010. I need to
I need to map a many-to-many relationship using Entity Framework Code First. Its a
I need to order by 2 columns using the entity framework. How is that
I need advice on using stored procedures with Entity Framwork 4.x to return data
I am using Entity Framework with C# to make a Silverlight application. I have
I am using Entity Framework code first for a simple database containing multiple choice

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.