dimanche 16 août 2020

Looping over DataRow to compare current row data and previous row data

I need to iterate over a DataRow in gridview, to compare the values from the current row and previous row. Appreciate if someone could help on this issue. I'm new

I am currently iterating like this, but i dont know how to continue:

//Check if current row ACTIVITY = LOAD_A and previous row ACTIVITY = LOAD_B is true , then store the value and do the sum calculation.

foreach (DataRow sda in dt.Rows)
 {

   if (sda.Field<string>("ACTIVITY") == "LOAD_A")
    {
  
    }
}

Aucun commentaire:

Enregistrer un commentaire