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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:52:07+00:00 2026-05-16T15:52:07+00:00

This is for an enterprise web application. We are building a front page/dashboard that

  • 0

This is for an enterprise web application.

We are building a front page/dashboard that queries our database for live statistics. The page has 3 update panels, each update panel has a user control that pulls data for it’s box. Lets call the user controls UC_NotStarted, UC_Active and UC_Finished.

We have built the queries that return the data and all of them take a while to run (~7 seconds each). So if we let the first page run with one update panel the image spins for ~21 seconds and display everything. We have broken that code into 3 update panels and set the loading to conditional. When we do this we get one box to load every 7 seconds. That’s a step in the right direction but they load sequentially (UC_NotStarted is queried waits 7 seconds and displays, then UC_Active goes for 7 seconds, and finally UC_Finished runs for 7 seconds). We are still at 21 seconds but data is being shown every 7 seconds.

We would like all of the data to be shown in 7 seconds since all of the update panels should be fetching the data at the same time. Instead of using LinqToSQL to pull the data I am now leaning towards web services to get it but not sure if that will work.

  • 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-16T15:52:08+00:00Added an answer on May 16, 2026 at 3:52 pm

    Look at the ThreadPool, specifically the QueueUserWorkItem method. It’s quite possible with this to run the 3 queries simultaneously and sit in a Thread.Sleep loop waiting for all three to finish executing so you can update all relevant parts of the page.

    The following code will almost certainly require tweaking but would give you a rough idea of how to do this:

    public class QueryResult
    {
        public bool Completed;
        public DataTable Result;
        public int ResultId;
    }
    
    public void GetData()
    {
        var QueryResults = new List<QueryResult>();
        queryResults.Add(new QueryResult() { ResultId = 1 });
        queryResults.Add(new QueryResult() { ResultId = 2 });
        queryResults.Add(new QueryResult() { ResultId = 3 });
    
        ThreadPool.QueueUserWorkItem(new WaitCallback(QueryRoutine), queryResults[0]);
        ThreadPool.QueueUserWorkItem(new WaitCallback(QueryRoutine), queryResults[1]);
        ThreadPool.QueueUserWorkItem(new WaitCallback(QueryRoutine), queryResults[2]);
    
        var completedResults = new List<QueryResult>();
        while(QueryResults.Count > 0)
        {
            for(int 1 = QueryResults.Count - 1; i >= 0; i--;)
            {
                if (queryResults[i].Completed)
                {
                    completedResults.Add(queryResults[i]);
                    queryResults.RemoveAt(i);
                }
            }
            Thread.Sleep(500);
        }
    
        // All background threads have completed, do something with the results,
        // return them to the front-end, etc,..
    }
    
    public void QueryRoutine(object qR)
    {
        var queryResult = (QueryResult)qR;
    
        // perform long running query here on a distinct thread, as QueryRoutine 
        // is now being run on three separate threads by the calls to QueueUserWorkItem
        // based on queryResult.ResultId picking the relevant query for values 
        // of 1, 2 or 3
    
        queryResult.Completed = true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose you're the product manager for an internal enterprise web application that has 2000
I have an enterprise Flex web application, served up over https, that runs fine
I assist in maintaining an enterprise web-based system (programmed in J2EE, but this is
I have been building enterprise software for the last 10 years. In this time
Here is the problem A user of an enterprise web application is performing a
I am an asp.net web application developer and I always have used Enterprise Library
Some of the users of our Ruby on Rails app have complained that page
I have a 100% Flex based enterprise web application with a Java/BlazeDS backend. In
I'm working on a web application that is Java EE 5. I may be
I'm creating a web application that requires the use of the perl module Crypt-SSLeay.

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.