I have a class module called by a web application that will set its connection string based on a session state variable set by the web app when a user logs on (actually multiple class modules). The connection string is set when the class is created. I now need to use the same class module in a windows application.
Best solution I've come up with so far is to test for the existance of the System.Web.HttpContext.Current object at initialization time of the class module. If it exists then get the connection string from the session state variable, else read the connection string from the app.config for the windows app creating the class.
Does anyone have any other ideas? I suppose I could pass the connection string when creating the class modules.