Rajavel G

Rajavel G

  • NA
  • 95
  • 44.2k

How to run progress bar while inserting data into sql?

Nov 17 2016 5:12 AM
I want to use runtime progress bar for my application..
 
private void Form1_Load(object sender, EventArgs e)
{
backgroundWorker1.RunWorkerAsync();
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
for (int i = 1; i < 100; i++)
{
Thread.Sleep(100);
backgroundWorker1.ReportProgress(i);
}
}
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
pBar.Value = e.ProgressPercentage;
this.Text = e.ProgressPercentage.ToString();
}
 
the above code is not working..
 
 help me to resolve..
 

Answers (1)