title: MVC 3 Creates a new database instead of using the one specified
body: <p>I'm creating a new MVC 3 pilot application using Mvc3 and the MvcScaffolding NuGet, everything runs smoothly until i want to use the database i already have. The application keeps creating a database with the format:</p>
  
  <p><code>projectname.Models.projectnameContext</code></p>
  
  <p>I'm stuck in here, my connectionStrings is:</p>
  
  <pre><code>&lt;connectionStrings&gt;
     &lt;add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /&gt; 
     &lt;add name="EnginesTrackingEntities" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=WARCHLAPPY\SQLEXPRESS;initial catalog=[EnginesTracking];integrated security=True;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt; 
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>In which specifies that my database is EnginesTracking.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I'm following the database first approach from <a href="http://weblogs.asp.net/paullitwin/archive/2011/08/11/use-mvc-scaffolding-in-database-first-mode.aspx" rel="nofollow">this example</a>. </p>
  
  <p>I have everything working perfectly but when the application starts, it creates a new table instead of using the one i specified.</p>
  
  <p>The only one difference is that there is no <code>databaseEntities</code> in my project, instead there is <code>projectContext</code> for which i cannot do the number 8 step</p>
  
  <p><strong>Update2</strong></p>
  
  <p>I'm kinda given up on this, going to follow codeFirst approach as this is taking to much time for only being a pilot. </p>
  
  <p>This is the Model1.context.cs:</p>
  
  <pre><code>//------------------------------------------------------------------------------
  // &lt;auto-generated&gt;
  //    This code was generated from a template.
  //
  //    Manual changes to this file may cause unexpected behavior in your application.
  //    Manual changes to this file will be overwritten if the code is regenerated.
  // &lt;/auto-generated&gt;
  //------------------------------------------------------------------------------
  
  namespace ErrorReportingSystem.Models{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;
  
    public partial class EnginesTrackingEntities : DbContext
    {
      public EnginesTrackingEntities()
          : base("name=EnginesTrackingEntities")
      {
      }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          throw new UnintentionalCodeFirstException();
      }
  
      public DbSet&lt;Engine_Part&gt; Engine_Part { get; set; }
      public DbSet&lt;Engines&gt; Engines { get; set; }
      public DbSet&lt;Error&gt; Error { get; set; }
      public DbSet&lt;Has_error&gt; Has_error { get; set; }
      public DbSet&lt;Locations&gt; Locations { get; set; }
      public DbSet&lt;Operators&gt; Operators { get; set; }
      public DbSet&lt;sysdiagrams&gt; sysdiagrams { get; set; }
    }
  }
  </code></pre>