I'm trying to teach myself .Net MVC 3, and am following this tutorial: http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/intro-to-aspnet-mvc-3 and have reached the step where you create the controller for the Model you created earlier (http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/accessing-your-model's-data-from-a-controller).
When I try to create the controller, I get the "The provider did not return a ProviderManifestToken string" error. A bit of googling leads me to believe this is due to an error with my connection string.
The thing is I'm not running SQL Server locally, so I can't copy the example connectionString. Here's what I've got now:
connectionString="Data Source=1.2.3.4\MSSQLSERVER;Initial Catalog=myDBname;Integrated Security=False;User ID=myUsername;Password=myPassword"
I've tried using SSMS to log on to the database using the username and password, and it works, so the problem is not with the user itself.
Any ideas?
If you are using SQL Azure, this error can be caused if the Azure Database Firewall is not set up to allow your IP Address. Make sure check to make sure you are authorizing the IP Address. This error doesn't necessarily point you in that direction.
I had same problem and solved it by following method. Just Check the db instance's Object name, it might be like:
If so, then replace it with MovieDBContext like:
(or what you set the Class name in Model/Movies.cs like
I figured it out: turns out that "\MSSQLSERVER" isn't needed in my case. I'm not sure if it's because I'm connecting by IP or if it's specific to my server setup, but removing it solved the problem.
I found my answer here:
I had the same problem until I came across this answer
DB Connection string in Web.config to use attached .mdf database won't work
"If you have the *.mdf placed in App_Data folder, using this format works:"
I also used the tutorial, but I had database file *.mdf otherwise than in the tutorial *.sdf.
Maybe this solution will be helpful.