[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

class module dispose - ASP.net app

I want certain stuff to fun automatically when I dispose of my class module (disconnect from database etc) what procedure should I put that kind of stuff in?
0
vbnetcoder
Asked:
vbnetcoder
  • 2
  • 2
  • 2
  • +1
1 Solution
 
starlite551Commented:
Use garbage Collector's Collect method on ur class module..
GC.Collect(object target)

Open in new window

0
 
starlite551Commented:
Sorry the correct way to call is this way :
GC.Collect();

Open in new window

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
CodeCruiserCommented:
If its a form, use the Closing event. If its module, use the appropriate (i think its Application.Exit) in application events file (access through Project Properties)
0
 
vbnetcoderAuthor Commented:
I am still looking at this issue.  I want this to stay open for now
0
 
vbnetcoderAuthor Commented:
ty
0
 
CodeCruiserCommented:
>what procedure should I put that kind of stuff in?
So would you be putting your stuff in GC.Collect procedure?
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now