The ConnectionString where you specify the Database that should be used is a property of the Connection-Class. Just create a Connection-Object and then set the user-specific ConnectionString before using the Connection.
edit:
An excerpt from my database-access-class, maybe it helps:
public class AdoDatabase
{
public string ProviderName { get; private set; }
public string ConnectionString { get; private set; }
public DbProviderFactory ProviderFactory { get; private set; }
public AdoDatabase(string providerName, string connectionString)
{
ProviderName = providerName;
ConnectionString = connectionString;
ProviderFactory = DbProviderFactories.GetFactory(providerName);
}
public DbConnection OpenConnection()
{
return OpenConnection(null);
}
public DbConnection OpenConnection(string databaseName)
{
DbConnection conn = ProviderFactory.CreateConnection();
conn.ConnectionString = ConnectionString;
conn.Open();
if (databaseName != null)
conn.ChangeDatabase(databaseName);
return conn;
}
}