Search code examples
sql-serverremoting

NT AUTHORITY\NETWORK SERVICE issue when deploying on remote server SQL 2005


I am getting a very non specific error when trying to connect to SQL server on remote server. I feel like I have made all the correct settings, allow TCP/IP, restarted the service, added rights to NT AUTHORITY\NETWORK SERVICE and other related users for the database. I can get to the aspx page, but as soon as I hit submit on the login I get:

Exception information: Exception type: SqlException Exception message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


Solution

  • On the remote server, create an alias for the server instance that forces TCP/IP and the port, and use that alias in the connection string. That way it won't even try to use DBNMP.

    Also you can try forcing the issue in the connection string: http://connectionstrings.com/article.aspx?article=howtodefinewichnetworkprotocoltouse