title: How can I upgrade my Sql Server CE 3.5 sdf database to Sql Server CE 4.0?
body: <p>I need to update my SqlCE3.5 database to 4.0.</p>
  
  <p>I get the following error message when I'm trying to access my 3.5 sdf/database using the new CE4.0 connection provide :-</p>
  
  <blockquote>
    <p>System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlServerCe.SqlCeInvalidDatabaseFormatException: The database file has been created by an earlier version of SQL Server Compact. <strong>Please upgrade using SqlCeEngine.Upgrade() method</strong>.</p>
  </blockquote>
  
  <p>Anyone know how I can do this? Obviously I need to do it programatcially but i'm not sure what I should do / what references I need to add, etc.</p>
  
  <p>Cheers!</p>