In an ASP MVC project I am using for Authentication the ASPNETDB.mdf in my App_Data folder , and as the project datasource a connection string to my SQL Server 2008 from my hosting provider.
My connection strings are :
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
<add name="myConnectionString" connectionString="Data Source=xx.xx.xx.xx;Initial Catalog=db_name;User ID=myid;Password=mypass" providerName="System.Data.SqlClient"/>
The issue is that locally, Authentication works just fine, but after I deploy my project, Authentication fails but the other connection to the data works.
I saw that for the first connection its using Windows Authentication.
Should i change the first connection string?
More than likely, the SQL instance on your deployed server is not SQLEXPRESS. You should use the same server name as you use in your second connection string.