Solved

What is the best way to updated a user when filling a dataset.

Posted on 2004-08-15
11
197 Views
Last Modified: 2010-08-05
Hello,

I'm building an application were I need to fill a large dataset before using it to display a crystal report. I has been taking up to 30 sec. to retrieve all the data from the server and I need a way to assure the user that the application has not froze up during this time. I cannot get a progress bar to work in this case and have also tried to display a form with an animated gif, but the gif does not animate during the data retrieval. I would like to be able to show the user a true progress if possible, any suggestions?

-Scott
0
Comment
Question by:scottlundstrom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
11 Comments
 
LVL 5

Expert Comment

by:Tom Knowlton
ID: 11806344
Change the mouse cursor to an hour glass?

//pseudocode...

try
{
//change mouse cursor to hourglass

....
....
some lengthy process....
...
...
}
catch(Exception eee)
{
  Tell use what happened during the lengthy process (why it failed)
  change mouse cursor to normal pointer
}
finally
{
  change mouse cursor to normal pointer
}
0
 
LVL 5

Expert Comment

by:Tom Knowlton
ID: 11806347
Maybe display another FORM while the process is running.


FORM A   opens   FORM B  (modal)

....some lengthy process.....

FORM B shows animated gif while it is open......

.....lengthy process ends......

close FORM B  (stop the animation)

FORM A is now receiving events once again.
0
 
LVL 5

Expert Comment

by:Tom Knowlton
ID: 11806380
I know you tried progress bar already....maybe this will help it work better:

http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B323116


Also...I've run across several articles that say you should thread lengthy events.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 5

Expert Comment

by:Tom Knowlton
ID: 11806388
Here's a fellow who looks like he's given this topic some thought:

http://www.c-sharpcorner.com/Code/2004/July/SingleThreadOps.asp

I hope this helps,

Tom
0
 

Author Comment

by:scottlundstrom
ID: 11806453
Thanks for the input, but I do not just want to show the hourglass and I cannot update the  progressbar (or know what to set the max value at) from the dataset. I've tried to display an animated gif on another form, but while the dataset is filling the gif will not animate. I have also tried launching the form using a new thread, but get out of memory errors. I have also tried to execute the dataset fill process on a new thread and use the original to display and keep the gif animated, but this is also giving me errors. I would really like to show the actual progress if possible, but would settle just for showing a gif if someone could give me an example of launching a new form on a new thread.

Scott
0
 
LVL 5

Accepted Solution

by:
Tom Knowlton earned 250 total points
ID: 11806678
Scott:

I understand.


I'll keep throwing stuff at you until something "sticks".  :)

Here is an example I worked through  (off of code project site)....please look through it and see if it can be molded to your needs:

http://www.robotzgame.com/junk/ProgressWindow1.zip
0
 
LVL 5

Expert Comment

by:Tom Knowlton
ID: 11806689
If you look at the source code for form 1.....this looks like just what you need:

private void button1_Click(object sender, System.EventArgs e)
            {
                  ProgressWindow progress = new ProgressWindow();
                  progress.Text = "Work";
                  System.Threading.ThreadPool.QueueUserWorkItem( new System.Threading.WaitCallback( DoSomeWork ), progress );
                  progress.ShowDialog();
            }



System.Threading.ThreadPool.QueueUserWorkItem( new System.Threading.WaitCallback( DoSomeWork ), progress );

You would replace  DoSomeWork   function guts   with  your   own   code.........



0
 
LVL 1

Expert Comment

by:chmohan
ID: 11812914
why dont u retrieve  the data in chunks and  show a  datagrid or so with the data retrieved ,and at the end create the report and display it
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Securing WEBAPI on Azure 2 54
Need help with another query 10 50
Can Selenium do Load Testing? 2 56
Concurrency Error Persistent using Data Grid View Update C# 2 24
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question