accessing environments at run time

Topics: User Discussion
May 14, 2007 at 10:57 PM
I dont know if this should be posted on the discussion board.. we used Database instance in Ent Lib June 2005. We have a feature in our ASP 1.1 application by which the user can switch to a different database instance like for Beta testing etc. Now we are migrating to ASP.Net 2.0 and I am interested in this April 3.0 release. I see the cool feature 'Environments" there a way that I can show a list of environments to the user in a drop down and change the applications?

This is my old code with database instances...this list was shown in a drop down which the user's used to switch between environments....

Dim result As New ArrayList
Dim settings As Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings
settings = CType(Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationManager.GetConfiguration(Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings.SectionName), Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings)
For Each instance As InstanceData In settings.Instances
Return result.ToArray(GetType(String))

thanks in advance
May 15, 2007 at 9:55 AM
Hi somasur -

This question might be best asked at the EntLib community (
This community focusses on contribution made to enterprise library (not enterprise library specifics, as they come out of the box.

Enterprise Library v3 support the concept of Environments, though it is not possible to change environments at runtime (this should be done when deploying an application).