title: SQL Server Compact 4.0 connection string for Entity Framework code first?
body: <p>I am creating an application for Windows XP so I am stuck with .Net framework 4.0. I tried to use SQL Server Compact and EF code first but it make an error when <code>update-database</code>. </p>
  
  <p>I wish to put the database in my code directory to deploy in customer machine.</p>
  
  <p>This is my connection string:</p>
  
  <pre><code>&lt;add name="QuanLyKhoContext" 
       connectionString="Data Source=MyData.sdf;Persist Security Info=False;AttachDBFileName=MyData.sdf" 
       providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p>And the error:</p>
  
  <blockquote>
    <p>This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection.</p>
  </blockquote>