Ramco Ramco

Ramco Ramco

  • 442
  • 3.4k
  • 528.5k

Deleted row information cannot be accessed thru the row

May 7 2023 4:52 PM

Hi

  I am getting this error after dt.delete()

foreach (DataRow row in dt.Rows)
{
    if (ND == (dtCount - 1) - init && (Convert.ToInt32(row[3].ToString().Trim()) < (Convert.ToInt32(HRpl) - 1)))
    {
        row.Delete();
    }
    if (ND == (dtCount - 1) - init && (Convert.ToInt32(row[3].ToString().Trim()) > (Convert.ToInt32(HRpl))))
    {
        row.Delete();
    }
}

Thanks


Answers (1)