>>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.
My application has 3 connections string:
-Production
-QA
-Dev
Each one of these environment has 4 databases. I very often have to join tables from different databases in a single query.
select *
from database1.dbo.table1 as t1
inner join database2.dbo.table2 as t2
on t2.xyz = t1.xyz
Because it is a JOINed query, I cannot rely on the connection string to resolve both tables.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com