locked
Accessing DataTable previous Row? RRS feed

  • Question

  • User451945003 posted

    How do I refer to row index.  I need to compare the data in the row before the active row in a foreach loop.

     

     

     

           foreach (DataRow row in dtGCats.Rows)
            {
                tempCG_ID = Convert.ToInt16(row["CG_ID"]);
                prevCG_ID = Convert.ToInt16(  need row -1, row before above current row)

    Friday, March 11, 2011 6:51 PM

All replies

  • User451945003 posted

    Removed post - took different approach.

    Saturday, March 12, 2011 12:48 AM