In a Winforms project I've been working on recently, I've been dutifully using using-statements for objects that implement IDisposable. I want to reopen a database connection, however because the using-statement that it was in earlier disposed the connection, I can't reopen it.So this leads me to the question, is it bad to only be using 1 connection for a small personal program that accesses 1 database (and 2 tables). At this point I am thinking of converting all those using statements into open() and close() statements.But that's not it. I still have to call dispose() before the program is closed. Is there a way for this to be called when the user exits out?
Why use using-statements when you want to reopen connections?
c#;database;sql;sql server;winforms