Entityexception when connecting to remote database

Asked

Viewed 324 times

2

When connecting to the local bank, the application works 100%. However, when I try to connect to sql server remotely (on a redehost server), the application raises the following Exception:

Below is the error and the connectionstring.

add name="Defaultconnection" connectionString="Data Source=HOST; Initial Catalog=bancodados;Integrated Security=True; persist security info=False;User ID=ID; Password=PASSWORD;" providerName="System.Data.Sqlclient"

{"The network path was not found"}

Is there any configuration in db or in the application that makes this connection impossible?

  • You can connect to this server via SQL Server Management Studio?

  • Once it happened to me, that in the place of the HOST I was passing the IP and did not even go with reza braba. Then I passed like this: Name_server Name_instance and I was able to connect. I don’t know if you have tried.

1 answer

1

For any remote connection to SQL you need to pass the IP\Nome_da_instancia. It may also be the Nome_Servidor\Nome_da_instancia, but then you depend on the name-solving part working properly. Also, make sure you can connect from SQL Server Management Studio. There are settings to be made on the host to allow remote connections.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.