Posted on: 6/19/2012 12:51:55 PM | Views : 232

I have a set of objects packaged together into a class library.  That class library DLL is included in a bunch of projects -- web projects, console applciations, etc.
The class library contains objects that abstract SQL tables within a database.  An application will instantiate a Employee object, for example, and use its methods and properties instead of direct SQL calls.  This is typical stuff here...
The objects within the class library know which database to connect with based upon the web.config file in the project they reside.  If you build another web or console application and decide to change the name of the connection string in the config file, the objects will now connect to the new database.  Simple, right?
So, my question is this: how can I dynamically change the database connection string based on user session without having to formally pass the db connection string into every object instantiation?  I would have to c ...

Go to the complete details ...