K
karl
I have created a class that connects to a SQL database when it is
created. This is a maintenance application that re-creates this class
at regular intervals. I am worried that I will be creating a lot of
connections to the database and leaving them open until the GC decides
to clean them. When the variable for the class goes out of scope is the
database connection closed or will it remain ipen until the GC fires?
This object may get created every 10 minutes.
Should I implement iDisposable and use the 'Using' block when I create
this object?
Thank you!
Karl
created. This is a maintenance application that re-creates this class
at regular intervals. I am worried that I will be creating a lot of
connections to the database and leaving them open until the GC decides
to clean them. When the variable for the class goes out of scope is the
database connection closed or will it remain ipen until the GC fires?
This object may get created every 10 minutes.
Should I implement iDisposable and use the 'Using' block when I create
this object?
Thank you!
Karl