473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

how to set Transaction scope in c#?

I have c# code something like below.
Expand|Select|Wrap|Line Numbers
  1.  
  2. void ExecuteSomething()
  3.     TransactionOptions transactionOptions = new TransactionOptions();
  4.   transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted;
  5.   transactionOptions.Timeout = TimeSpan.FromSeconds(TransactionTimeOutInSeconds);
  6.  
  7.   using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions))
  8.   {
  9.       action();
  10.       transactionScope.Complete();
  11.   }
  12. }
  13.  
  14.  
i am retrieving the data by using above code

From some other code i am calling some function in c# through windows service. That function is going to delete some unwanted data from sql server database. if i wanted i initiate the request it will take 30 min to delete the data.

in this 30 min time i am unable to access other pages in my website. is there any better way to design this?
Jul 2 '12 #1
2 2920
Plater
7,872 Expert 4TB
So this is being done on the webserver? Hmm I think you can still use threads right?
I have never done it, but long running tasks like are usually implimented in a way where you have a unique token that references the "job" and you can keep refreshing the page to find out if it is complete.
You could look up ways to handle that sort of thing, there might be a good explanation of it somewhere
Jul 2 '12 #2
Get the current value of the first element in the set of matched elements.You need to specify in the script which field you want to use as an input field. Assuming it's HORAS2, then the script will be och.
http://dapfor.com/en/net-suite/net-g...ial/data-types
Aug 17 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: mukesh | last post by:
Hi, Suppose I have four different functions. All four update four different tables. I want to execute these functions in a transaction. TRANSACTION START CALL A=FUNCTION1() CALL...
4
by: liming | last post by:
Hi, I know it's possible to have transactions with Typed DataSet, but I have yet to find an example of it. For example, I have two typed TableAdapter CommerceDataSet.xsd ...
2
by: Martin Z | last post by:
I'm using the TableAdapterHelper to set the connection and transaction properties on all the commands of all my typed table adapters.... I've checked at the time of the error and all the commands...
5
by: Allan Ebdrup | last post by:
I'm using dotNet 2.0 and System.Transactions to run transactions that span multiple database queries, Now I would like to log any Sql errors that occur in the transaction, but when I insert the...
3
by: GaryDean | last post by:
I'm using TransactionScope as follows... using TransactionScope myScope = new TransactionScope()) { using (SqlConnection conn = new SqlConnection()) { conn.ConnectionString =...
2
by: cmrhema | last post by:
Hello I am trying to run a program to check for transaction scope I have written the following code. But it seems I need to add a namespace or reference What namespace am I supposed to add ...
0
by: =?Utf-8?B?Sm9l?= | last post by:
Very weird; I lost a day worth of work because of this problem. I have an ASP.NET application written in VB that is using MySQL database. Shortly, a page creates a Customer record in the database...
1
by: Randa | last post by:
I'm Using Transaction Scope to implement a transaction against SQL Server 2000. Locally its working Perfectly and no problem happens; but when trying to do the same action on a remote server it...
2
by: RP | last post by:
I have a code like this: ========================================== private void cmdProceed_Click(object sender, EventArgs e) { GenerateAll(); } ========================================== ...
4
by: Aamir Mahmood | last post by:
Hi I am using System.Transactions.TransactionScope to implement the transactions in my code. When the transaction is rolled back because of any reason, I want all the objects that were...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.