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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:20:22+00:00 2026-05-23T18:20:22+00:00

SQL Server Compact doesn’t support distributed transactions. So if there are more than one

  • 0

SQL Server Compact doesn’t support distributed transactions. So if there are more than one connection inside TransactionScope – the exception is thrown. Is there any way to setup ADO.NET provider to use one connection for the same connection string?

I understand I can use usual transactions through connection.BeginTransaction but TransactionScope is preferable for me.

UPDATE.
Sorry, I didn’t mention I work with Entity Framework, so I have no control on SQL Command. I may just pass connection string. And by some reason several connections objects created for one connection string inside TransactionScope.

  • 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-23T18:20:22+00:00Added an answer on May 23, 2026 at 6:20 pm

    Updated answer (code sample from here):

    using (var context = new MyContext())
    {
        using (var txscope = new TransactionScope())
        {
            context.Connection.Open();
            // do query 1
            // do query 2
        }
    }
    

    Update

    Another solution, as you said, is to create a connection object and use it in constructors for the Object Context.

    More information about when Entities opens new connection.

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

Sidebar

Related Questions

It doesn't look like SQL Server Compact Edition supports the RANK() function. (See Functions
I was creating a table in SQL Server CE and realized it doesn't support
SQL Server Compact does not support identity column when it is used with the
Does it make sense to use SQL Server Compact for a desktop application? How
Does anyone know the best way to create a SQL Server CE (Compact 3.5)
I am running Sql Server Compact Edition 3.5.1.0 SP1 in a multi-thread application. The
I Use a Sql Server Compact Edition Database File For Store the Data in
I can see SQL Server Compact Destination under Data Flow Destinations, but I am
I'm learning SQL Server Compact for a program I'm writing that requries a local
I am using LINQ to SQL with Sql Server Compact Edition 3.5 and VS2008.

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.