Um. I'm not surprised.
Your code is effectively
int j = 2;
for (int i = 0; i < j; i++)
{
j++;
}
because inside your
for
loop you add a variable number of rows to
rptData.Tables[0]
and then use the number of rows in the table to control the loop. So if you ever get to the position where a row causes a copy of itself to be added to the table, then it will start an infinite loop, and you will run out of memory because you create new objects each time round.
I don't know what you are trying to do, but I can't help thinking that you are going about it the wrong way!