Search code examples
.netentity-frameworkado.netwindows-authentication

Need to generate a windows authentication connection string


I added an ADO.NET entity data model to my project but it did not add a connection string to this project (the project was not the active on startup project at creation, if that helps). I am unsure how to generate a connection string for the project as it does not appear in any of the .config files in the project nor does it appear in the "Active Project at startup" .config files.


Solution

  • When creating a model from the database you will be asked to provide a connection string. Sometimes this connection string can be lost (for instance when checking code into source control).

    If you need to re-enter the connection string you can open your edmx file, and click the white area, then view the Properties window to see the connection string property. Alternatively you can set the connection string in the app.config file using the connection strings section.