I was thinking about building a method that I could pass in the connString to in order to generate my SqlConnection.
Is that a bad idea? Is it better if I just wrap my calls in their own using (SqlConnection statements?
We had issues with another app where one of the devs was passing the connection around and keeping it open, which was causing a lot of grief.
Just wanted to ask the experts before attempting something that could lead to issues.
This is the common pattern I use and I think it’s good:
Where
DatabaseConnection.ConnectionStringToDbis a static helper class property I create to fetch or store connection string.