First of all you can't switch between databases using the connection string.
Instead you should use Catalog names overwrites in the config file too.
Please refer to the manual "Using the generated code -> Application configuration through .config files"
At runtime you can get the source catalog name from any field you have.
(remember you can entities from more than one catalog in the same project)
All you have to do is to use the SourceCatalogName property of the EntityField (SelfServicing)
Or the same property but of the FieldPersistenceInfo of any entityField2 (Adapter)