In our web project, we have a custom Database Connection class that creates the SqlConnection object and get the DB connection string for us from the web.config.
While this is nice, there's one problem. All projects inside our web project depend on that web.config being there so that this class can work.
There are needs to use this db connection from our DL in other solutions or projects that should not require a web.config such as a Console project that is trying to use lets say some of the DL methods from our web project to do some data manipulation.
Consequently, when I add some of our BL project methods to my console solution, it's looking to create the DB connection but I have no web.config in my Console application of course so it bombs out.
Is there a better way to manage the creation of the SqlConnection than: a) putting that class in a web project b) making that connection reliant on web.config keys
so that non web based projects can use the BL without that BL referencing and being reliant on a connection that is reliant on ultimately keys in a web.config?