Re: connections from a data access class never get closed
Posted by: Sven Franke
Date: January 13, 2005 08:07AM

When using a datareader, the connection need to be open i thought. I was struggling with it when I made a function that returned a datareader (but I wanted to close the connection before returning). After some attempts I'm now returning a dataset (that is disconnected).

It works fine for me with a dataset instead of datareader.

After filling a dataset (or executing a query) I will close the connection and that works ok. I was trying to use Dispose, but this wouldn't close the connection in my service so the # of connection was increasing every time the query was executed. I now simply use .Close() and everything is ok.

Maybe this can be of some use for you.

Sven

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.