i have a small program that when i run it, it throw me an error exception.
my code is
am trying to delete a certain row in the table but when i run it, ti give me the error
"error deleted row information cannot be accessed through the row"
can someone explain me why this certain error????
my code is
Code:
for (int columnumber = 0; columnumber <= columsize; columnumber++)
{
if (EpidemiologicalTable.Columns[columnumber].ColumnName.Equals(CodeName))
{
for (int k = 0; k < updaterowcount; k++)//it search in the update table
{
for (int i = 0; i < rowsize; i++)//it search in the EpidemiologicalTable
{
string rowname = Convert.ToString(EpidemiologicalTable.Rows[i][0]);
int rowvalue = Convert.ToInt32(EpidemiologicalTable.Rows[i][columnumber]);
if (dataupdate.Rows[k][0].Equals(rowname))
{
DataRow selectedRow = dataupdate.Rows[k];
if (rowvalue == 0)
{
MessageBox.Show("delete" + rowname + " " + rowvalue + " " + k);
selectedRow.Delete();//remove the corrspoding row from the result table
}
}
}
}
}
}
"error deleted row information cannot be accessed through the row"
can someone explain me why this certain error????
Comment