StrataFrame Forum

browse ith records on the GridView if errors rerun record or run next record ?

http://forum.strataframe.net/Topic33371.aspx

By Dong Trien Lam - 8/19/2016

"Browse ith record in the GridView if error rerun faulty records" this is my request, using a while loop 2, while outer ring running again if the ith sample error message, the sample code below if An error occured not run very well, but there are problems caused ith GridView on jump number and apparently does not run again faulty records, when defective block catch (Exception ex) is run, it gets in the error message in the block catch (Exception ex) and i will run continuously variable for every row (or rows) of the GridView, thanks to the help you troubleshoot.

     private void Tinh(object sender)
        {
            DevExpress.XtraGrid.Views.Grid.GridView Gv = (GridView)sender;
          
            i = 0; // int i is a global variable used to browse the ith record of GridView
            // bStop is the global variable bool
            while (i < Gv.RowCount && bStop)//Running faulty loop next record
            {
                try
                {
                    // While i have not stopped yet, the East and the next run
                    while (i < Gv.RowCount && bStop)// Running the main loop
                    {                             
                        if (condition)
                        {
                            //do somthing
                        }
                        else
                        {
                            //do somthing   
                        }
                         i++;
                    } // Running the main loop                    
                }                 
                catch (Exception ex)               
                {
                     i++;
                     Debug.Print("error: " + ex.Message);               
                }
            }// Repeat loop faulty next record
        }