title: Unable to retrieve metadata - MVC application
body: <p>I was following <a href="http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/accessing-your-models-data-from-a-controller" rel="nofollow noreferrer"><strong>this</strong></a> to create a simple <strong>MVC</strong> application. After creating the model, when I tried to add controller, I got the following error :  </p>
  
  <p><strong>Unable to retrieve metadata for "MvcApplication.Models.Movie". Invalid value for key "attachdbfilename".</strong>  </p>
  
  <p><img src="https://i.stack.imgur.com/QCc1c.png" alt="enter image description here"></p>
  
  <p>Can someone tell why I am getting this error.  </p>
  
  <p><strong>Update</strong> : I saw <a href="https://stackoverflow.com/questions/15445786/add-controller-error-unable-to-retrieve-metadata"><strong>this</strong></a> wherein solution is provided by changing the providerName. But in my case it is already <strong>System.Data.SqlClient</strong>. Following are my connectionStrings :  </p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-MvcApplication-20130708120940;Integrated Security=SSPI" providerName="System.Data.SqlClient" /&gt;
      &lt;add name="MovieDBContext" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True" providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>