Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

What happens to datarows?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael Jackson - 19 Aug 2005 17:29 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.