• Dominic Gagné (6/29/2015)


    thanks for the answer. I don't use a DataReader, only retrieve an integer value, so I don't need to close anything

    I think both datareader and executescalar use a database connection, and from what I've read on the web (sample code), the executescalar uses a connection that can subsequently be closed after use. Maybe you could experiment with closing your connection (note, this is not closing a datareader or execute scalar, but the _connection_).

    For instance, I see the oConn (in your case) get closed after the oCmd (in your case) gets disposed.

    I've learned a few things with shaking up some dot net code, but clearly you still want to test plenty! Obviously just a suggestion, and I could be completely full of it!