progressbar developing through a datatable

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

I need some help developing a simple progressbar as it loops through a
datatable. I can get the count of rows the for each runs through but I
don't know how to use this information to control the progressbar.

Sounds easy and I'm sure it is, but it's giving me too much difficulty for
some reason.

Thanks for any help.

Bernie Yaeger
 
Hi Bernie,

ProgressBar pb;
pb.Maximum = table.Rows.Count;
pb.Value = 0;
for (int i = 0; i<table.Rows.Count; i++)
{
// do something with table
pb.Value = i+1;
}

If you have lengthy loop I would suggest you to put it into background
thread cause of form's refreshing.
 
Hi Miha,

Thanks for your help.

Bernie
Miha Markic said:
Hi Bernie,

ProgressBar pb;
pb.Maximum = table.Rows.Count;
pb.Value = 0;
for (int i = 0; i<table.Rows.Count; i++)
{
// do something with table
pb.Value = i+1;
}

If you have lengthy loop I would suggest you to put it into background
thread cause of form's refreshing.
 
Back
Top