Copying the connection string to the service layer
In the previous section we added an entity model to the data access layer project. The connection string is stored in the App.config
file in the LINQNorthwindDAL
project. However this configuration file is only used by the .NET Entity Modeler to retrieve schema information from the database at design time. At runtime the configuration file in the service interface layer is used to get the actual database connection string. So, in this section, we will copy and paste this connection string to the service interface layer project.
The following are the steps to add this connection string to the service interface layer:
Open the file,
App.config
, in theLINQNorthwindDAL
project.Copy the connection strings part in this file which should be like this:
<connectionStrings> <add name="NorthwindEntities" connectionString="metadata=res://*/Northwind.csdl|res://*/Northwind.ssdl|res://*/Northwind.msl;provider=System.Data.SqlClient;provider...