[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

class module dispose - ASP.net app

Posted on 2011-02-12
7
Medium Priority
?
339 Views
Last Modified: 2012-05-11
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
Comment
Question by:vbnetcoder
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 12

Expert Comment

by:starlite551
ID: 34879507
Use garbage Collector's Collect method on ur class module..
GC.Collect(object target)

Open in new window

0
 
LVL 12

Accepted Solution

by:
starlite551 earned 2000 total points
ID: 34879530
Sorry the correct way to call is this way :
GC.Collect();

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34879979
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
 

Author Comment

by:vbnetcoder
ID: 34999317
I am still looking at this issue.  I want this to stay open for now
0
 

Author Closing Comment

by:vbnetcoder
ID: 35296319
ty
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35296518
>what procedure should I put that kind of stuff in?
So would you be putting your stuff in GC.Collect procedure?
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month20 days, 8 hours left to enroll

867 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