title: Connection String - N-Tier Application
body: <p>I have had a dig around for an answer to this issue but everything previously asked seems to be a complex variation on this and doesn't answer the question so I thought I should just ask.</p>
  
  <p>I am developing a three tier application with the following.....</p>
  
  <ul>
  <li>DAL - Data Access Layer using Entity Framework</li>
  <li>BLL - Business Logic Layer</li>
  <li>Web App - MVC Web Application</li>
  </ul>
  
  <p>I have created an Entity Framework model, repository classes and my connection string is in the DAL App.Config file. I have now created my first class in the BLL and it references the DAL. When trying to test the following, very basic method I get an error relating to a missing connection string in the BLL. </p>
  
  <pre><code>public static List&lt;DAL.Item&gt; getItems() {
  
          List&lt;DAL.Item&gt; result = new List&lt;Item&gt;();
  
          DAL.Repositories.ItemRepository myRepository = new    DAL.Repositories.ItemRepository();
          result = myRepository.GetAll().ToList();
  
          return result;
  
      }
  </code></pre>
  
  <p>Why is the BLL looking for the connection string? Am I missing something really obvious here?</p>
  
  <p>If I need to include the connection string across multiple layers, which defeats the purpose of the n-tier structure, then how is the best way to do this? Can anyone shed some light on this for me?</p>