I'm getting the following error:
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
I've just created my first ever EF project. It's an MVC app and I added the entity model in the MVC project. I also added a DataAccess class and a class for running tests using NUnit. Eventually, I'll add a service class which will reference the DataAccess class. So, the code currently looks like this (I'm just trying to get a test working to prove EF is doing its thing):
- Text Fixture calls DataAccess class
- DataAccess class calls Entity Framework
- Entity Framework accesses a local database
For the time being, I'm just trying to return all rows/one column from one table. Remember, all these files are in a single project. I've read quite a lot that this problem stems from having multiple projects, but that doesn't seem to apply in my case. I've checked in the "main" web.config file. The connection string looks okay. I copied that same config section (i.e., connectionStrings) into the Debug-specific config file, too, but that didn't make a difference. Any ideas why I'm seeing this error?
Thanks, Jay
Connection strings:
This is the connection string from the dialog box when creating the Entity Access file (data source is a period in both strings [i.e., local host]):
metadata=res:///EntityDataModel.csdl|res:///EntityDataModel.ssdl|res://*/EntityDataModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.;Initial Catalog=URIntake;Integrated Security=True"
This is the connection string from the web.config file. They seem the same, for all practical purposes:
metadata=res:///EntityDataModel.csdl|res:///EntityDataModel.ssdl|res://*/EntityDataModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=URIntake;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"