I have problem when I try to connect to LocalDB from Visual Studio 15. I have installed SQL Server Express 2016
I'm following this tutorial: http://www.asp.net/mvc/overview/getting-started/introduction/creating-a-connection-string
I create a model and context (MovieDBContext) class and try to setup a connection:
<connectionStrings>
<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" />
<add name="MovieDBContext" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True" providerName="System.Data.SqlClient"
/>
When I try to access the page where I show all movies:
public ActionResult Index()
{
return View(db.Movies.ToList());
}
I get this exception:
I tried to edit the connection strings like this, and this does not work either:
<connectionStrings>
<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" />
<add name="MovieDBContext" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True" providerName="System.Data.SqlClient"
/> </connectionStrings>
I get this exception when I use (local)MSSQLLocalDB
What am I doing wrong?

