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

  • Home
  • SEARCH
  • 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 1104221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:27:12+00:00 2026-05-17T01:27:12+00:00

How to do transaction control on data access using DataAdapter and Stored Procedure in

  • 0

How to do transaction control on data access using DataAdapter and Stored Procedure in C#? Currently I want to execute 2 stored procedure calls via DataAdapter, but I want to do transaction control on it. Is there any way to do it?

  • 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-17T01:27:13+00:00Added an answer on May 17, 2026 at 1:27 am

    The preferred way of doing so is to use transaction scopes to handle this for you. Just surround the body of code that invoke both stored procedure calls with a new TransactionScope:

    using(TransactionScope scope = new TransactionScope())
    {
      // your ADO.NET code that calls sprocs ...
    }
    

    Any calls to the database that occur on the same connection will automatically be combined into a single transaction. You can also specify whether the code within the transaction scope should enlist in an existing transaction or start its own via the optional TransactionScopeOption parameter.

    This is the preferred manner of combining calls into a single transaction. The alternative, is to manually acquire a DBTransaction by calling Connection.BeginTransaction() – performing your work and then calling tran.Commit().

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

Sidebar

Related Questions

I just made a transaction go through but not sure where there is a
We have a .Net application that initiates a transaction using NHibernate and modify data
I'm using AWS' SimpleDB as intended for the most part, but also want to
Spring supports programmatic transaction which give us fine grained control over TX management. According
I'm using a transaction to insert multiple rows in multiple tables. For these rows
I'm trying to implement database value edition through a DataGridView control but honestly I'm
I have an entity mapped in NHibernate with optimistic concurrency control using a SQL
I'm working on some data access logic with Spring, my question has to do
As apart of my learning, I want to learn more about the data controls
Well, my project was using EJB and JPA (with Hibernate), but I had to

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.