Dong Lam Trien

Dong Lam Trien

  • 732
  • 986
  • 146.6k

browse ith record on the GridView if errors run next record?

Aug 20 2016 12:13 AM
"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.
[CODE]
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
}
[/CODE]

Answers (1)