c# - Entity Framework ConnectionString won't update after changing App.Config in runtime

app-config c# connection-string entity-framework entity-framework-6

Question

I'm working on a WPF application that uses Entity Framework to access data. I must first update the app after creating a new connection string based on the user's input. Set up in accordance with that.

The issue is that Entity Framework still utilizes the outdated startup-time ConnectionString for creating the DbContext after changing the App.Config file.

How can the ConnectionString setting for the Entity Framework be changed at runtime?

1
8
6/12/2015 2:33:36 PM

Accepted Answer

ZZZ_tmp
7
6/12/2015 2:29:39 PM

Popular Answer

I made the same mistake. The "Initial Catalog=" part of my new connection string was missing.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow