You have a list of databases, all you have to do is use the selected name as a part of your connections string.
So set a static connection string in your app:
public static strConnect = "";
and you can access that when you need it:
using (SqlConnection con = new SqlConnection(MyClassWhereIPutIt.strConnect))
{
...
}
Then all you need to do is construct the connection string. There are two ways to do this:
1) If you databases all use the same user and password details, it's simple: construct a "basic" connection string with a placeholder for the DB name:
const string basic = @"Server=[server_name]; Database={0}; password=[password]; user = [user_name]";
And use Replace to set the name:
strConnect = basic.Replace("{0}, nameOfTable);
2) If they don't, then you will need to maintain a valid connections string list somewhere (I'd suggest in a table in a "master" DB in SQL which lets you fetch a working connection string from SQL using the required DB name in the WHERE clause.)