0

I have developed a WPF application that runs some tasks in the background. Whenever it wants to connect to database I get an error. Everything works fine in local test, but it fails in Server.

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

I have checked connectionstring and enabled TCP/IP for database, but nothing has changed.

4
  • Is database on a host or a server? Commented Jan 27, 2018 at 10:54
  • Can you at least ping the remote server from the machine where you run your application? Can you connect to that server using Management Studio? Commented Jan 27, 2018 at 10:57
  • Both application and database are on server -@AshkanMobayenKhiabani Commented Jan 27, 2018 at 11:11
  • check out my answer, and also make sure that applicationpool user have access to database Commented Jan 27, 2018 at 11:17

1 Answer 1

1

If the database is on a server, make sure that you have made the rule on the firewall to allow port 1433 (default SQL server port), if it is on a host, make sure that you are using the correct port, some hosts may change the default port and use another one like 1533.

To make sure that everything is correct try to check it with Sql Management Studio.

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

1 Comment

setting rule on port 1433 didn't help

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.