title: Db connection string in MVC 4
body: <p>I have the following problem:</p>
  
  <p>When I run my code:</p>
  
  <pre><code> public ActionResult Index()
      {
          return View(db.Movies.ToList());
      }
  </code></pre>
  
  <p>I reach an error saying: Unable to complete operation. The supplied SqlConnection does not specify an initial catalog.</p>
  
  <p>would you be able to help me fix the connection string this is my connection string:</p>
  
  <pre><code> &lt;connectionStrings&gt;
        &lt;add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-MvcMovie-20121214234752;Integrated Security=SSPI" providerName="System.Data.SqlClient" /&gt;
    &lt;add name="MovieDBContext" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=SSPI" providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>    using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Data.Entity;
  
  namespace MvcMovie.Models
  {
      public class Movie
      {
          public int ID { get; set; }
          public string Title { get; set; }
          public DateTime ReleaseDate { get; set; }
          public string Genre { get; set; }
          public decimal Price { get; set; }
      }
  
      public class MovieDBContext : DbContext
      {
          public DbSet&lt;Movie&gt; Movies { get; set; }
      }
  }
  </code></pre>
  
  <p>Any help will be appreciated.</p>