Search code examples
c#.netarchitectureado.net3-tier

When i use ado.net model in 3-tier architecture and i tries to load the data from DAL to UI it asks for connection string in UI app.config


Problem with connectiong string in 3-tier architecture using ADO.NET model. When I try to load data from database using ADO.NET context it asks for connection string when it has already added in DAL app.config but it asks for it in UI.


Solution

  • The connection string must be on the .config file on the project which will execute, for sample, windows forms, web application, wpf, wcf, web api, mobile projects. If add a connection string on a app.config file on a class library project, it will not affect your project. You have to keep it on the project which will execute the solution.