Connection string for SQL Server Express on remote Computer login failed error

拥有回忆 提交于 2019-12-06 20:48:25

I see a few issues:

  1. 2.221.1.145 is a strange IP address. That's not a intranet address, its an internet address. But that is not your primary issue here

  2. Your connection string is using SQL logins, not windows (trusted) logins. So your user id should not have a domain in front of it.

Assuming you want to use SQL Logins (these can be simpler to troubleshoot)

  1. Add a SQL User (not windows user) to your server with login Andy and password mypass

  2. Use this connection string: Server=2.221.1.145;Database=Database;User Id=Andy;Password=mypass

RenegadeAndy

Finally worked it out.

Turning the security to be both Windows and SQL authentication. Then following : How can I create a user in SQL Server Express database I added to my project? followed by GRANT EXECUTE to all stored procedures fixed us up with exactly what we needed!

Usually this error occurs when the machine on which the application has been running not having the access to Andy-PC\Andy.

We should use domain specific account instead of machine specific accounts when we need to use windows authentication.

Otherwise we have to use SQL authentication.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!