I really re-read your question, you do not need two connection lines. Your query team can affect any database you want after you connect. For instance:
string query = @"SELECT * FROM [FirstDataBase].[dbo].[table1]
INNER JOIN [SecondDataBase].[dbo].[table2]";
using(SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionString[@"db"].ConnectionString))
using(SqlCommand command = new SqlCommand(query, connection))
{
}
, . , SQL Management Studio .