Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-15
11
Medium Priority
?
200 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 1000 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

610 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