How should I edit an Entity Framework connection string?

DeveloperDan picture DeveloperDan · Mar 14, 2011 · Viewed 109.8k times · Source

I recently had to edit my app.config file to change the connection string for an Entity Framework data model (.edmx file). But I'd like to know: Is there a way to edit the EF connection string using the designer?

The original connection string is auto-generated by the Entity Data Model wizard. The connection string then cannot be changed - it remains disabled in the properties window of the .edmx designer. I like to avoid editing XML by hand if I can (in app.config), so I was wondering if there is a way to get back into the original wizard screen to make connection string changes and let the tool edit the app.config file for me.

Answer

Fabian Nicollier picture Fabian Nicollier · Mar 14, 2011

If you remove the connection string from the app.config file, re-running the entity Data Model wizard will guide you to build a new connection.