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
schneider - 19 Aug 2005 17:34 GMT
Just one, but the GC may lag..
> I think I know the answer to this, but memory problems make me think I'm
> wrong.
[quoted text clipped - 13 lines]
>
> Michael
schneider - 19 Aug 2005 17:56 GMT
Oh, Plus the data rows in the initial DataSet, but you could use a
DataReader
> I think I know the answer to this, but memory problems make me think I'm
> wrong.
[quoted text clipped - 13 lines]
>
> Michael
Marina - 19 Aug 2005 20:33 GMT
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.
>I think I know the answer to this, but memory problems make me think I'm
>wrong.
[quoted text clipped - 13 lines]
>
> Michael