There are a lot of good reasons not to do this. Leaving connections open
indefinitely has many potential problems, connection pooling being the most
noticeable.
However, you could implement IDisposable and take care of it there.
"csharpbeginner" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
My requirement is a certain database connection should be
closed only when the object is unloaded from memory. Is
the class destructor a good place to close open database
connections? Thanks in advance for your reply.