• 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 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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