I have a data access layer that is compiled as a class library and compiles to a dll. Historically, the dll provided data access to my database for my web application. It works just fine, but what its doing is it is pulling my connection string from the web.config. This is fine too, but now I want to use this data dll in a Windows Form application. Is there a way for the DLL to know if its running inside a web application or winform application and to appropriately pull the connection string from either the web.config or app.config file?