What happens to datarows?

  • Thread starter Thread starter Michael Jackson
  • Start date Start date
M

Michael Jackson

I think I know the answer to this, but memory problems make me think I'm
wrong.

I have a filled strongly typed dataset, 1 table, many rows (thousands)

Given the following code:

For each MyRow As DataRow in MyDataSet.Table.Rows
Debug.WriteLine(MyRow.LastName)
Next

At this point, do I have thousands of instances of a datarow in memory, or
just one?

Thanks

Michael
 
You always have as many rows as are in your dataset. Since they are in the
dataset, they are in memory - whether or not the loop is there, they are all
still there.

The loop does not add any rows. All it does, is adds another variable MyRow,
that points to one of the rows in the dataset.
 
Back
Top