Showing Progress while filling a dataset

  • Thread starter Thread starter Scott Lundstrom
  • Start date Start date
S

Scott Lundstrom

I have a large amount of data I'm dropping into a dataset and would
like to find a way to at the very least show the user that the program
is working at retrieving the data and not locked up.

I have been unable to find a way to do this with a progress bar so I
thought that I would try to disply a message with an animated gif, but
I cannot get the gif to animate while the dataset is being filled
which is not doing me any good.

Any ideas? Please help.

Scott
 
I have a large amount of data I'm dropping into a dataset and would
like to find a way to at the very least show the user that the program
is working at retrieving the data and not locked up.

I have been unable to find a way to do this with a progress bar so I
thought that I would try to disply a message with an animated gif, but
I cannot get the gif to animate while the dataset is being filled
which is not doing me any good.

Any ideas? Please help.

Scott


The way I would do it is set of a separate thread, and have a callback
that runs at the completion of the dataset fill. The call back would
then cause the progress ui to stop.
 
Hi!
the best way is create progress bar like i'm doing every time:
i create new form with that contain only progress bar control and show it
like that:
frmProcess p = new frmProcess();
Cursor.Current = Cursors.WaitCursor;
p.progressBar.Maximum = gridEX1.RowCount;
p.progressBar.Value = 0;
p.Show();
for(int i=0;i<gridEX1.RowCount;i++)
{
...
p.progressBar.Value = i;
Application.DoEvents();
}
 
OK, I have tried to start a new form using a new thread that will show
the user a message and run an animated gif while the dataset fills up,
but I keep getting 'Out of memory errors'. I sure the mistake I'm
making is simple, but can someone run down the correct way to display
a new form using a new thread?

-Scott
 
Hi,

This was duscussed last week, below is the code I posted.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation




public delegate void ProcessedFileHandler( );
Thread workingThread;

private System.Windows.Forms.ProgressBar progressBar1;

void Done()
{
MessageBox.Show("Done");
this.Close();
}

void ImportImage( )
{

// Load datagrid

//inform the UI that I'm done
this.progressBar1.Invoke( new ProcessedFileHandler( this.Done), null);
}

private void ImportImages_Load(object sender, System.EventArgs e)
{
this.workingThread = new Thread(new ThreadStart(this.ImportImage));
this.workingThread.Start();
}
 
Back
Top