I am using LINQ to SQL to connect to the database from my application. When I change the environment from production to stage, I can update the connection string in web.config. But there is another value that I need to update when the environment changes. This is the name of the database. In the LINQ to SQL constructor file, the database name is referred to as an attribute -
[System.Data.Linq.Mapping.DatabaseAttribute(Name="somedbname")]
How can I get the name value dynamically from some configuration file?
Any help really appreciated.
source
share