How do you change an MVC3 web app to use a remote server for the data context? I tried changing the connection string the in web config (and restarted everything) but it still uses the local SQL database.
Edit: my connection string is below
<add name="ApplicationServices" connectionString="Data Source=zzz.database.windows.net;Initial Catalog=SMS;Persist Security Info=True;User ID=xyz;Password=abc" providerName="System.Data.SqlClient" />
Edit 2: I tried commenting out everything inside the <connectionStrings> tag. The site still works. I’m a bit confused, is the connection set somewhere else?
If you are using Entity Framework code first (which comes with asp.net mvc 3), the name of the database class corresponds with the name of the connection string. For example if you have a class like this:
The name of your connection string should also be DataContext. More info here at step 4.