I am creating a desktop application in winform that will use the Sqlite Database.
So, I created a Sqlite Helper class that uses System.Data.SQLite , and each method of this Helper class opens and closes a connection.
But now I also added the ability to attach additional databases, but after the connection is closed, all connected databases are lost.
To fix this, I modified the class so that the connection opens in the constructor and remains open.
After the application finishes, I want this connection to close without explicitly calling the Close method.
Any suggestions on how to do this?
user850010
source share