Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Entity Framework Perplexities
Message
General information
Forum:
ASP.NET
Category:
Entity Framework
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Network:
Windows Server 2012
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01646424
Message ID:
01646471
Views:
26
>>
>>The connection strings are usually in the config file so just a question of using different configs for the two databases.
>>Find the EntityContainerName in Edmx properties and look for that in the configuration/connectionStrings section.
>>The actual connection string for the SQL server is contained in the connectionString property (provider connection string)
>
>Can I change config at runtime using the same .exe? Or would it entail 2 different builds? (pardon my ignorance).
>
>Alternatively, I think I know where to find the connections strings now, but I'm not sure how I can "inject" this at run time.

I usually create a custom configuration (although you might be able to use the standard 'Debug' and 'Release' configurations) and use web.config transforms. Little bit of work setting up but well worth it once in place since you only have to change 'common' settings in one place. See:
https://msdn.microsoft.com/en-us/library/dd465318(v=vs.100).aspx
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform