Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3348960
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:36:22+00:00 2026-05-18T01:36:22+00:00

Here is the scenerio: On application open the user is asked to open a

  • 0

Here is the scenerio:

On application open the user is asked to open a “Project”

Inside a project there are processes, categories, tasks, documents and notes.

There are a few more, but lets keep it simple. Most of the items above are lists that are bound to grids or treeviews.

Each of them have a separate database table and are linked with values in the database.

So after a user opens a project I could do something like this:

  1. Get Processes that belong to Project ‘A’
  2. Get Categories that belong to each process
  3. Get Tasks that belong to each category
  4. Get Documents that belong to Project ‘A’
  5. Get Notes that belong to Project ‘A’
    and so on

The issue is then if the user closes this Project I have to clear every bound control and clear any variables related, then be ready to open another Project.

So what I am looking for is some advice for the way to handle this type of situation efficiently.

I am using C# .Net, and the application is a Windows Forms application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:36:23+00:00Added an answer on May 18, 2026 at 1:36 am

    Well, any way you slice it, the memory allocations done on load will have to be cleaned up at some point.

    Depending on how you do your data access, you may have to do it manually, or .NET’s garbage collector may take care of it for you (most likely).

    For this type of application (given the limited requirements you’ve written), I would normally implement it as an MDI application so you could have multiple projects open at once. All of the project loading/disposing code would be run through the child window, so any time a child window is closed, the memory gets cleaned up automatically.

    Even if you don’t/can’t do MDI, I would strongly recommend that you follow the dispose-on-unload model instead of keeping the same form open and reinitializing it with new data. The latter model is very prone to erroneous behaviour because of lingering data and/or state (which is programmer error, but is really difficult or even impossible to track down when trying to reproduce a client’s issue). I’ve seen this pattern a lot in WinForms and it isn’t pretty when the form controls and business logic start to get complicated. Dump the form and start again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the scenario: A C# Windows Application project stored in SVN is used to
Tackling a strange scenario here. We use a proprietary workstation management application which uses
Here's the scenario: You have an ASP.Net application supported by a Microsoft SQL Server
Here's a standard scenario: if(string.IsNullOrEmpty(Configuration.AppSettings[foobar])) throw new SomeStandardException(Application not configured correctly, bozo.); The problem
Here's the scenario: 1: Our WPF application starts 2: The WPF application loads various
Here's the scenario: ASP.NET MVC2 Web Application Entity Framework 4 (Pure POCO's, Custom Data
Here's the scenario I have an ASP.NET 4.0 application which has a LOT of
Here is the scenario We are load testing a web application. The application is
Our project has about 20 developers, but our application makes relatively light use of
Here's my scenario - I have an SSIS job that depends on another prior

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.