why not escape to catch an error when i next run?


Author
Message
Dong Trien Lam
Dong Trien Lam
StrataFrame User (263 reputation)StrataFrame User (263 reputation)StrataFrame User (263 reputation)StrataFrame User (263 reputation)StrataFrame User (263 reputation)StrataFrame User (263 reputation)StrataFrame User (263 reputation)StrataFrame User (263 reputation)StrataFrame User (263 reputation)
Group: Anonymous / Guest
Posts: 57, Visits: 251
I have the following code structure:
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
}

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search