I am working on my 1st mvc razor project. I set the project and on the 1st run I am getting an error that the _appstart.cshtml page can’t connect to the database.
I can see the db in the app_data folder and on this line of code I am getting error:
WebSecurity.InitializeDatabaseConnection("StarterSite", "UserProfile", "UserId", "Email", true);
This is my 1st time working on mvc razor project, and every advice is welcome about what should I enter there.
UPDATE:
conn string in web.config:
<connectionStrings>
<add name="StarterSite" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\StarterSite.mdf;User instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>
Make sure your connection string is pointing to the correct location (database). You can find it in your Web.config file in your solution.
e.g.