Problem looping over rows created within the same loop

I'm re-writing an application that was originally coded in Paradox. It was set up to add "events" to a table when other rows in the table contained a certain number of "points" or a certain amount of time had passed:

i.e.:

ID: 1
Event: Start Date
TotalPoints: 0
PointReductionDate: null

ID: 2
Event: Point Violation
TotalPoints: 2
PointReductionDate: 9/15/2006

ID: 3
Event: Point Reduction
TotalPoints: 1
PointReductionDate: 10/15/2006

ID: 4
Event: Point Reduction
TotalPoints: 0
PointReductionDate: 11/15/2006

The setup is a lot more complicated than this (multiple reset types, multiple event types and exceptions, user can add events at any position), but this is the general idea. ID 3 and ID 4 need to be automatically generated when the report is generated after the point reduction date.

Paradox currently handles this by looping through the table and when it adds records, they automatically get added to the loop and re-processed. I can't figure out how to mimic this in .NET - I've tried using a DataSet, but I can't figure out how to have it re-process just-added records.

Any advice would be much appreciated.



Answer this question

Problem looping over rows created within the same loop

  • Martin Goodliffe

    UPDATE: I solved this with a DataReader, a few while loops for each reset type, and a few extra calls to the database.
  • Problem looping over rows created within the same loop