This is in C#, Visual Studio 2008, crystal reports that came with VS2008
I've got a crystal report viewer form that resides in a DLL. The DLL is responsible for loading the crystal report (based on report filename), and displaying the report on the form.
When I'm done with the crystal report, i call dispose on the loaded reportdocument object. However, the database connection remains.
Crystal seems to detect that there are other connections (from my main application) to the same database, and keeps its connection open. The crystal connection is closed when the main applications database connection is closed.
Is there any way to force crystal to close its connection, with out closing the main applications database connection?
How are you connecting to the database, by creating your own connection at runtime via setting the authentication or are you letting Crystal do the connection via the stored connection in the report? If you are doing your own connection in any way, shape, or form, you have to manually close the connection and call the dispose before disposing the report.
It is quite possible this is a memory leak. I have experienced these before. There is also a memory leak issue with Crystal Reports and is talked about on their forum quite a bit but no fix was issued when I was using it a few years ago. I ditched Crystal for other options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With