title: When to use .mdf and when .sdf?
body: <p>After seeing a lot of things in the internet I haven't found any explanation between the two file types: <code>.mdf</code> and <code>.sdf</code>.</p>
  
  <p><code>.sdf</code> would be a compact version of SQL Server (<code>.mdf</code>) I believe. Still they appear utterly different.</p>
  
  <p>Have followed the two tutorials on msdn, i.e. <a href="http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/intro-to-aspnet-mvc-3" rel="nofollow noreferrer">MVC Movie App</a> and the <a href="http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-1" rel="nofollow noreferrer">Musicstore</a>. Both use <code>.sdf</code>.</p>
  
  <p>Partial quote (<a href="https://stackoverflow.com/questions/12169590/where-is-that-file-on-my-system">full</a>): 'First of all it should be "|DataDirectory|ASPNETDBContext.mdf" (notice the extension difference). Your applic...'</p>
  
  <p>Both tutorials have the connection string to <code>.sdf</code>, i.e.:</p>
  
  <pre><code>&lt;add name             ="MovieDBContext"
       connectionString ="Data Source=|DataDirectory|Movies.sdf" 
       providerName     ="System.Data.SqlServerCe.4.0"
  /&gt;
  
  &lt;add name             ="MusicStoreEntities" 
       connectionString ="Data Source=|DataDirectory|MvcMusicStore.sdf" 
       providerName     ="System.Data.SqlServerCe.4.0"
  /&gt; 
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p>My question is what to use where and when? More over <strong>why</strong> to use which where.</p>