title: Cannot drop database because it is currently in use MVC
body: <p>I'm brand new to using MVC, and I'm trying to use an initializer to initialize data into my DB when the application is first started.  Here is what I've got in Global.asax.cs:</p>
  
  <pre><code> System.Data.Entity.Database.SetInitializer(new MyAppInitializer());
   MyAppContext db = new MyAppContext();
   db.Database.Initialize(true);
  </code></pre>
  
  <p>In Web.config, here is my connection string:</p>
  
  <pre><code>&lt;connectionStrings&gt;
    &lt;add name="MyAppContext"
    connectionString="data source= MyServer; Integrated Security=True; database=MyDatabase"
    providerName="System.Data.SqlClient"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is using MS SQL 2008 R2.  My Initializer looks like this:</p>
  
  <pre><code>public class MyAppInitializer : DropCreateDatabaseAlways&lt;MyAppContext&gt;
  {
      protected override void Seed(MyAppContext context)
      {
          var organizations = new List&lt;Organizations&gt;
          {
              new Organizations { OrgName = "AT", OrgPhone = 5093333433, OrgOfficeLocation = "ITB", OrgPointOfContact = "Tony", OrgIsActive = 1 },
              new Organizations { OrgName = "Libraries", OrgPhone = 5093331122, OrgOfficeLocation = "Holland-Terrell", OrgPointOfContact = "Herald", OrgIsActive = 1 }
          };
          organizations.ForEach(s =&gt; context.Organizations.Add(s));
          context.SaveChanges();
  </code></pre>
  
  <p>I made sure I closed my connection to the server and database in SQL Server Management Studio, but multiple people have access to this DB, although none should be using it right now.  How can I get it so I can initialize this data in my DB?  Thanks!</p>
  
  <p>Edit: I've already got the DB created on the server, but it is completely empty (no tables, procedures, etc).  Would this cause an issue?</p>