Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Entity Framework Perplexities
Message
Information générale
Forum:
ASP.NET
Catégorie:
Entity Framework
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Network:
Windows Server 2012
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01646424
Message ID:
01646471
Vues:
27
>>
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform