title: SQL Express connection string: mdf file location relative to application location
body: <p>I am using SQL Express databases as part of a unit test project in c#. My databases is located here:</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>./Databases/MyUnitTestDB.mdf
  </code></pre>
  
  <p>I would like to use a relative path or variable in the <code>app.config</code> rather than having my connection string defined as:</p>
  
  <pre class="lang-none prettyprint-override"><code>AttachDbFilename=C:\blah\blah\blah\yea\yea\yea\MyApplication\Databases\MyUnitTestDB.mdf 
  </code></pre>
  
  <p>I have seen the use of <code>|DataDirectory|</code> but am I correct in thinking this is only applicable to web applications?</p>
  
  <p>I want to control this in the application configuration file, as in production the application uses a hosted sql database.</p>