sqlite-net icon indicating copy to clipboard operation
sqlite-net copied to clipboard

Can I Close the SQLiteConnect and then open it?

Open Hoper-Q opened this issue 1 year ago • 1 comments

I found SQLiteConnect only have close and dispose. That means if I want to use SQL every time, I must re-instantiate a new SQLiteConnection() or keep it open all the time. Or does it automatically reopen if it’s closed every time a command is executed?

Hoper-Q avatar Nov 27 '24 06:11 Hoper-Q

I found SQLiteConnect only have close and dispose. That means if I want to use SQL every time, I must re-instantiate a new SQLiteConnection() or keep it open all the time. Or does it automatically reopen if it’s closed every time a command is executed?

Best practice is to simply keep the connection open. Unless you have very explicit reasons to close a connection while your application is still running, it is best to simply keep the connection open.

ghost avatar Jan 11 '25 15:01 ghost