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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:52:53+00:00 2026-06-06T21:52:53+00:00

I am getting this error The transaction must be disposed before the connection can

  • 0

I am getting this error

The transaction must be disposed before the connection can be used to execute sql statements.

i have an Excel file that contains about 6000 rows and I uploaded these file into Data table in typed dataset, then I am trying to apply my business logic on these rows in dt.

The exception throws from the second loop and I have to do two loops; why does this exception occur, and how can I solve it?

Here is my code:

try
{
    using (TransactionScope scope = SysInfo.BeginTransaction(IsolationLevel.Serializable))
    {

        //Here is my Typed dataset

        //Method Looping through row in Datatable & Calling DB

        //another Method Looping through row in Datatable & Calling DB

        scope.Complete();
    }
}
catch (Exception ex) { throw ex; }   
  • 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-06T21:52:55+00:00Added an answer on June 6, 2026 at 9:52 pm

    I solved it by adding the below lines in App.config:

    <configuration>
        <system.transactions>
            <defaultSettings timeout="00:01:30" />
        </system.transactions>
    </configuration> 
    

    and this in Machine.config:

    <configuration>
        <system.transactions>
            <machineSettings maxTimeout="00:01:30" />
        </system.transactions>
    </configuration>
    

    As this process takes a very long time greater than 10 minutes, so I found that I need to overwrite this value with a higher one.

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

Sidebar

Related Questions

I am getting this error: Transaction count after EXECUTE indicates a mismatching number of
I keep getting this error and have no idea why. I googled and scanned
I'm getting this error (Distributed transaction completed. Either enlist this session in a new
I'm getting the following error: Transaction count after EXECUTE indicates a mismatching number of
I am currently getting this error: System.Data.SqlClient.SqlException: New transaction is not allowed because there
I am getting this error: Network access for Distributed Transaction Manager (MSDTC) has been
I am getting this error. I have my hibernate connections and MVC all setup
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
Getting this error when try to add an item to my repositories/context: Collection has

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.