Shehzad Khan

Shehzad Khan

  • 1.2k
  • 158
  • 6.5k

C# datatable loop while deleting record during loop

Jun 21 2022 8:58 AM

Hi,

I have something to convert to C# as it is.

Legacy Code

LocalCursorTable

LocalCursorTable.Movefirst

Do While not EOF

   if condition passed then

     -- do something

          LocalCursorTable.Delete (Delete record from local cursor )

   endif

   LocalCursorTable.MoveNext  

Enddo

After End of iteration LocalCursorTable should not have records which r deleted in above loop.

Any advise/suggestion how to achive this in C# datatable.

Regards

Shehzad

 

 


Answers (3)