1

Trying to Publish ASP.NET MVC Website, Database is on different Server and asp.net files are on a different. I develop this site on my personal computer, using VS12, both db and frontend on same machine, now when I am publishing the site, its giving me error when connecting to db

> <add name="RWWEntities"
> connectionString="metadata=res://*/Models.RWWModel.csdl|res://*/Models.RWWModel.ssdl|res://*/Models.RWWModel.msl;provider=System.Data.SqlClient;provider
> connection string=&quot;data
> source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\RWW.mdf;integrated
> security=True;multipleactiveresultsets=True;application
> name=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Change it to

> <add name="RWWEntities"
> connectionString="metadata=res://*/Models.RWWModel.csdl|res://*/Models.RWWModel.ssdl|res://*/Models.RWWModel.msl;provider=System.Data.SqlClient;provider
> connection string=&quot;Data Source=202.198.12.11;Initial
> Catalog=PalRWW;User ID=PalRWWUser;Password=<pass>;integrated
> security=True;multipleactiveresultsets=True;application
> name=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Please help.

0

2 Answers 2

2

The original appears to use a local file db and the new one connects to a remote database - most likely SQL Server. Your sql server on the remote machine doesn't know about the user your website app pool user is running under. If you're on a domain you can run the site under a domain user and give permissions on the SQL server to the domain user. Otherwise, can alter your connection string to supply a database user id and password and ensure that user is setup on the database and has appropriate permissions. If you're using entity framework and expecting it to generate your database then your user has to have admin rights to create a database.

Sign up to request clarification or add additional context in comments.

Comments

1

Your permissions are setup for integrated security, and chances are that your server is not setup for integrated security, and will require SQL authentication with a user and password with adequate permissions to your DB.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.