Solved

Hanging on frm.show when the business object contains a collection w/ > 5000 objects

Posted on 2004-08-05
3
204 Views
Last Modified: 2010-04-23
The following roughly describes the sequence of events:

- mdi menu click event asks the business tier to populate an object

- parent business object calls the database and populates itself.  This includes a collection of 5000 child objects.  While debugging I can see that this successfully completes

- control returns to the MDI form where it Dims a windows form

- the windows form is successfully given a reference to the business object

- frm.Show is called

Execution in the debugger runs as expected until frm.show is called.  At this point execution hangs, CPU usage redlines, the form never appears, and I eventually stop the debugging (or, if I am running without the debugger, I must kill the program).  I can successfully load the form when I have only 1000 child objects.  Why would 5000 cause this failure... out-of-memory comes to mind, but why would it not fail while the 5000 objects are being created?  Furthermore, 5000 hardly feels like a "scary" number!

Thank you in advance for pointing me into the right direction to uncover my error!
0
Comment
Question by:bmccleskey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 250 total points
ID: 11731932
what is the form doing on its load with the collection ?
0
 

Author Comment

by:bmccleskey
ID: 11732333
You pointed me into the right direction, and it was a silly mistake on my part.  I had assumed that execution was not making it into the form load event, so I didn't have a breakpoint set within the "being created" form.  Once I set the breakpoint and stepped into the form_load event, the bug in my looping logic was easy to spot.

A million thanks.
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11732336
glad you got it.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question