Creating a Connection String and Working with SQL Server LocalDB
<p>I have problem when i try to connect to localdb from visual studio 15.
I have installed SQL Server Express 2016 </p>

<p>I folowing this tutorial: <a href="http://www.asp.net/mvc/overview/getting-started/introduction/creating-a-connection-string" rel="noreferrer">http://www.asp.net/mvc/overview/getting-started/introduction/creating-a-connection-string</a></p>

<p>I create model and context(MovieDBContext) class and try to setup connection:</p>

<pre><code>&lt;connectionStrings&gt;
    &lt;add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-MvcMovie-20130603030321.mdf;Initial Catalog=aspnet-MvcMovie-20130603030321;Integrated Security=True" 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;
</code></pre>

<p>When i try to access to page where i show all movies :</p>

<pre><code> public ActionResult Index()
 {
     return View(db.Movies.ToList());
 }
</code></pre>

<p>I get this exception:
<a href="https://i.stack.imgur.com/DJ5vh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DJ5vh.png" alt="enter image description here"></a></p>

<p>I try to edit connection strings like this and also not working:</p>

<pre><code>  &lt;connectionStrings&gt;
    &lt;add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-MvcMovie-20130603030321.mdf;Initial Catalog=aspnet-MvcMovie-20130603030321;Integrated Security=True" providerName="System.Data.SqlClient" /&gt;
    &lt;add name="MovieDBContext"   connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True" providerName="System.Data.SqlClient"
/&gt;  &lt;/connectionStrings&gt;
</code></pre>

<p>I get this excpetion when i use <code>(local)MSSQLLocalDB</code></p>

<p><a href="https://i.stack.imgur.com/yXiR9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/yXiR9.png" alt="enter image description here"></a></p>

<p>What i do wrong ?</p>