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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:44:22+00:00 2026-05-16T05:44:22+00:00

So i’m dealing with an ASP.NET 4.0 Web Forms Application in which the DAL

  • 0

So i’m dealing with an ASP.NET 4.0 Web Forms Application in which the DAL is built with a combination of LINQ-SQL and classic ADO.NET (for auditing transactions, and bulk updates).

I have an admin page on the site which performs an update on a bunch of records (could be thousands), and not to mention there is T-SQL triggers in place on those records. Needless to say, its a killer of an update.

So of course, the page is timing out.

The update transaction is performing with the following code:

db.ExecuteCommand("UPDATE [tblFoo] SET [IsFoo] = 0 WHERE [Bar] = {0}", bar.Id);

So it’s a classic ADO.NET bulk update.

What i’ve tried to do is make the call to this method asynchronous, by firing off a thread on the button click on the form:

protected void MyButton_Click(object sender, EventArgs eventArgs)
{
    var thread = new Thread(OnMyAsyncMethod) { Name = "Hi, im a thread, how are you?"};
    var dataArray = new object[2];
    dataArray[0] = someData;
    dataArray[1] = someData2;
    thread.Start(dataArray);
}

The method OnMyAsyncMethod simply executes the above ADO.NET call.

This solved the UI problem, being the page now posts back and refreshes immediately. But then around 30 seconds lateri see that wonderful little flashing light on my Visual Studio toolbar – “an unhandled exception has occured, would you like to attach to process, etc”.

So of course, now the actual call in the DAL is timing out.

Am i doing this wrong – is there a way i can perform the update transaction (db.ExecuteCommand) totally asynchrously?

Hopefully you see what im trying to do – i just need to fire off a killer of a T-SQL transaction. The only thing i need back from the call is the number of rows updated.

Any ideas people?

  • 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-16T05:44:23+00:00Added an answer on May 16, 2026 at 5:44 am

    Solved issue by increasing timeout for that specific command.

    db.CommandTimeout = 300; // set timeout to 5 minutes
    

    But i’m open to some better suggestions.

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

Sidebar

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.