>The same application is using 4 databases so I cannot alwasy rely on the connection string to handle my problem.
I don't understand. I have all my connection strings defined in a configuration file and I only switch to the related one when I need it. So, in my application, I can query on various connection strings based on the connection string I am going to use in the data provider class.