title: Where to store connection string for class library in desktop application? Can I use in app.config?
body: <p>I am new to desktop application development and currently building a desktop application using layered architecture (user interface, DAL, BLL).</p>
  
  <p>In web development I used to store the connection string in web.config and my class library was accessing it from there. Please guide me how &amp; where connection string should be stored for DAL in desktop application. I tried to add an <code>app.config</code> file in my class library and access the connection string like this:</p>
  
  <pre><code>ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString)
  </code></pre>
  
  <p>But it throuws an error: <em>"Object reference not set to an instance of an object."</em></p>
  
  <p>Kindly guide me on this. Thanks for your support and sharing.</p>