i




 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why not escape to catch an error when i next run?
02-23-2017, 01:15 PM
Post: #1
why not escape to catch an error when i next run?
I have the following code structure:

Code:
bool bStop = true;
int RowCount = 65000;
private void btnRun_Click(object sender, EventArgs e)
{
            int i = 0;
            //int iErr;
            while (i < dataGridView1.Rows.Count - 1 && bStop)//Loop 1
            {                
                while (i < dataGridView1.Rows.Count - 1 && bStop)// Loop 2
                {
                    try
                    {
                        if (i > 0) dataGridView1.Rows[i-1].Selected = false;                    
                        dataGridView1.Rows[i].Selected = true;
                        dataGridView1["ROWS", i].Value = "Processing...";
                        System.Windows.Forms.Application.DoEvents();

                        Thread.Sleep(1000);
                        Debug.Print("are in Try and i: " + i);

                        //if (chkErr.Checked == true)
                        //{ iErr = "E"; }
                    }
                    catch (Exception ex)
                    {
                         Debug.Print("are in Catch and i: " + i + " ex: " + ex.Message);
                         //If an error occurs this place, why not escape to run i next catch ?
                    }
                    
                    i++;
                }// Loop 1
            }//Loop 2
}



Quote


Possibly Related Threads...
Thread: Author Replies Views: Last Post
  browse ith records on the GridView if errors rerun record or run next record ? dongtrien 0 609 08-20-2016 04:18 AM
Last Post: dongtrien
  after compiling *.exe a program from vb6 file does not run on win7? dongtrien 0 905 01-04-2016 08:46 AM
Last Post: dongtrien
  run only a Single Instance of the Application using Windows Forms nisar87 0 2,222 09-05-2010 05:40 AM
Last Post: nisar87



User(s) browsing this thread: 1 Guest(s)