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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:46:11+00:00 2026-05-13T06:46:11+00:00

I am using transactionscope to ensure that data is being read to the database

  • 0

I am using transactionscope to ensure that data is being read to the database correctly. However, I may have a need to select some data (from another page) while the transaction is running. Would it be possible to do this? I’m very noob when it comes to databases.

I am using LinqToSQL and SQL Server 2005(dev)/2008(prod).

  • 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-13T06:46:11+00:00Added an answer on May 13, 2026 at 6:46 am

    Yes, it is possible to still select data from a database while a transaction is running.

    Data not affected by your transaction (for instance, rows in a table which are being not updated) can usually be read from other transactions. (In certain situations SQL Server will introduce a table lock that stops reads on all rows in the table but they are unusual and most often a symptom of something else going on in your query or on the server).

    You need to look into Transaction Isolation Levels since these control exactly how this behaviour will work.

    Here is the C# code to set the isolation level of a transaction scope.

    TransactionOptions option = new TransactionOptions();        
    options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;        
    using (TransactionScope sc = new TransactionScope(TransactionScopeOption.Required, options)
    {
        // Code within transaction
    }
    

    In general, depending on the transaction isolation level specified on a transaction (or any table hints like NOLOCK) you get different levels of data locking that protect the rest of your application from activity tied up in your transaction. With a transaction isolation level of READUNCOMMITTED for example, you can see the writes within that transaction as they occur. This allows for dirty reads but also prevents (most) locks on data.

    The other end of the scale is an isolation level like SERIALIZABLE which ensures that your transaction activity is entirely isolated until it has comitted.

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

Sidebar

Related Questions

I have some code using a System.Transactions.TransactionScope , that creating a new instance of
i have some simple SELECT statements and an INSERT wrapped in a using(TransactionScope...) block.
I am using 'TransactionScope', and I need to just do some DML within the
I am using TransactionScope to add a object's data to one database. pseudo code:
I'm using TransactionScope to submit data in Linq to SQL. My question is, if
I've been using TransactionScope to work with the database and it feels nice. What
I have this code in Transaction.cs using (TransactionScope scope = new TransactionScope()) { //
I have a code like this: try { using (TransactionScope scope = new TransactionScope())
I'm writing some Unit tests against a database, and we're using transactions to make
I'm using TransactionScope to do some batch insert and updates. Problem is, I'm getting

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.