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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top