Entity-framework – How should I edit an Entity Framework connection string

app-configconnection-stringentity-frameworkentity-framework-4

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.

Best Answer

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.