An app to browse to other databases?

Topics: Data Access Application Block
Jan 24, 2008 at 6:31 PM
It appears that EntLib data access does not lend itself to browsing system catalogs and changing databases programmatically. The only way to get a database object is DatabaseFactory.CreateDatabase(), and it can only read connection strings from a config file. It doesn’t look like there is a way to programmatically change to a different database without calling DatabaseFactory.CreateDatabase and referencing a different named database in the config file. It looks like one cannot discover databases programmatically with EntLib. One can only open those that are defined in the config.

You can of course drop down to ADO.NET and use the dbConnection.Changedatabase() method, but then you cannot use the EntLib database object methods because that will create a new connection and return you to the database defined in your connection string.

Is this true? Can I use EntLib DataAccess to build a tool that lets a user pick a Database at runtime that isn't predefined in a config file?