After creating a mvc 3 web site using code first & adding same date to my db , I have up upload my db to my share hosting sql and change my connectionStrings ,
But when I’m running my site on my local machine it had recreate a db on my machine and did not approach the connectionStrings db , how ever I cant c the connectionStrings to any local db and my Appdata it empty (the db was never in my appdata folder)
Where can it store the connectionStrings ? and what did I do wrong?
thanks
<add name="ApplicationServices"
connectionString="Data Source=11.11.111 .123;
Initial Catalog=DB_Name;
User ID='UserName';
Password='UserPAss';
" providerName="System.Data.SqlClient" />
Have you considered changing the connection strings back to what they were in your web.config before you published your site? Unless I’m mistaken, EF Code First uses the local running SQLExpress Instance by default, not mdf files in the App_Data directory.
Then I would try to use web.config transforms when you publish your site.
http://msdn.microsoft.com/en-us/library/dd465318.aspx