When I google "MVC connection string" or something similar, I get a bunch of questions/articles about this, and all of those I have read says to edit a Web.config file. Is there any reasons for this not working in my project?
My project uses Entity Framework, and now it works on a local db. I have edited 2x Web.config files (one in the project folder, and another in the Views folder - I dont really know the difference). These files did not originally have any <connectionStrings> tags, so I added this manually, to both files:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=mysite.database.windows.net;Initial Catalog=Developer;User ID=user;Password=pass" providerName=".NET Framework Data Provider for SQL Server"/></connectionStrings>
.. but it still uses my localhost database. Is there any obvious thing Im missing??
EDIT:
Deleting debug and rebuilding did not work.
Here is my context class
public class TrackerContext : DbContext
{
public TrackerContext() : base() {}
public DbSet<Toll> Tolls { get; set; }
public DbSet<TollRecord> TollRecords { get; set; }
public DbSet<Trip> Trips { get; set; }
public DbSet<TripRecord> TripRecords { get; set; }
}
No connection strings. Can I force it in somehow??
mysite.database.windows.netin visual studio server explorer?