J
Jeff S
I have a class that is used exclusively for database access. What is the
recommended method of opening and closing connections in this scenario.
Should I create/open the SqlConnection in a class constructor and then close
it in a destructor? Alternatively should I open a new SqlConnection during
every method call and then explicitly close it at the end of the method
call? What are the important factors I should consider?
Thoughts, recommendations opinions, considerations, facts?
Thanks!
recommended method of opening and closing connections in this scenario.
Should I create/open the SqlConnection in a class constructor and then close
it in a destructor? Alternatively should I open a new SqlConnection during
every method call and then explicitly close it at the end of the method
call? What are the important factors I should consider?
Thoughts, recommendations opinions, considerations, facts?
Thanks!