Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Automatically close SqlConnection


Message #1 by clemens.wyss@h... on Mon, 11 Nov 2002 16:53:23
Dispose() or myConn.Close()

-----Original Message-----
From: clemens.wyss@h... [mailto:clemens.wyss@h...]
Sent: 11 November 2002 16:53
To: ASPX_Professional
Subject: [aspx_professional] Automatically close SqlConnection


Hi all,
I have singleton wrapper around a SqlConnection object. Upon first fetch 
of the singleton the DB-connection is opened.
Now I would like to automatically close this connection whenever the page 
rendering is done (i.e. just before returning the http response). Is 
there an event (or hook-method) I can make use of?

Alternative: is there a hook method in Object which is called upon 
disposal (i.e. garbage collection)?

Regards
Clemens

  Return to Index