|
|
Posted on 8/29/2015 7:09:58 PM
|
|
|
|

The project is made of MVC plus three layers together, there is this error, it took half an hour to get it done, let's talk about the solution and reason!
The model layer prioritizes reading the web.config under the mvc and does not read its own app.config, which should be consistent with the connectionStrings under the web.config node
Solution:
Put the MVC project in web.config
<connectionStrings> <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-StudentMVC-20150818051648;Integrated Security=SSPI" /> </connectionStrings> Replace the node information in app.config of the model layer
Refer to the article below!
The specified named connection is not found in the configuration, is not planned for use with the EntityClient provider, or is invalid.
(1)web:
You need to add a connectionString node to the client configuration file, which describes the connection information of the EntityClient.
For example:
Add a connectionString node to web.config, which describes the connection information of the EntityClient. (connectionString is missing some information, so it is error.) )
(2)winfrom:
Add a connectionString node to app.config, which describes the connection information of the EntityClient. (connectionString is missing some information, so it is error.) )
(3) An error message appears when calling the ADO.NET Entity Data Model of another library:
"The specified named connection is not found in the configuration, is not planned for use with the EntityClient provider, or is invalid." } System.Exception {System.ArgumentException}
It is generally said that your connectstring is not set up, but it is indeed set in the class library of your Data Model.
Workaround: Your current project also needs to configure the same connectstring to avoid errors, add the same connectionStrings to App.Config or Web.config and the library where the Data Model is located
|
Previous:Ashley Madison website database download, total 9.69G, with Thunderbolt BT download linkNext:How to send a VPN
|