Which config file to put the db connectionString for ADO.NET (3.5) Entity Data Model?

Normally this goes in the App.config. VS2008 designer wizard automatically creates this file and puts it in the same location as the  assembly in which your database layer resides. But if you’re calling that assembly from an ASP.NET app, you’ll  need to move that connectionString to the Web.config.  Otherwise, you’ll get this error upon  instantiation of the ObjectContext:

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

0 comments: