ASP.NET application using old connection string.

Posted by Doug S. on Stack Overflow See other posts from Stack Overflow or by Doug S.
Published on 2011-02-25T15:02:39Z Indexed on 2011/02/25 15:24 UTC
Read the original article Hit count: 363

I am trying to publish a website using ASP.NET MVC3 EF and CODEFIRST with a SQL Server 2008 backend. On my local machine I was using a sql express db for development, but now that I am pushing live, I want to use my hosted production database. The problem is that when I try to run the application, it is still using my local db connection string. I have completely removed the old connection string from my web.config file and am using the <clear /> tag before creating the new connection string. I have also cleaned the solution and rebuilt, but somehow it is still connecting to the old db. What am I missing?

This is the new connection string:

  <connectionStrings>
    <clear />
    <add name="CellularAutomataDBContext"
         connectionString=" Server=XXX;
         Database=CellularAutomata; User ID=XXX; Password=XXX; Trusted_Connection=False" 
         providerName="System.Data.SqlClient" />  
  </connectionStrings>

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about entity-framework