SQLSERVER error in C#application

Asked

Viewed 401 times

3

I have a problem related to the SQLSERVER database.

I try to connect from a point to the server and error appears:

Instance-specific or network error when connecting to SQL Server. The server was not found or not accessible. Check that the instance name is correct and that SQL Server is configured to allow remote connections

Obs 1 : The database is "running" normally on the local(server).

Obs 2 : After battery testing, the TCP/IP configuration is OK. (PORT 1433 OK)

Obs 3 : I can access normally also via IIS.

Note 4: I changed the database to another server and it worked normally.

Note 5: It was working until yesterday ....

Obs 6 : In 2 physical points the problem occurred.

Obs 7 : I usually pinged from the physical points to the server(ok)

groundwork :

Data Source=192.168.1.1;
Initial Catalog=banco;
User ID=sa;
pwd=senha;
MultipleActiveResultSets=True;
Connection Reset=True;
Connection Lifetime=600
  • What is the instance name and which connection string is using? Please post the question

  • In reality Felipe was using directly and only the ip as a path, because it was only 1 instance enabled (SQLEXPRESS). In case I’m wrong you can correct me!

  • Sql Server doesn’t "like" IP very much. Switch to the name of the instance that should work. But pass the full name.

  • No, I don’t think I’m wrong. Actually, I already tried to connect via IP and never could. I think my SQL SERVER was not configured for that. Tried using the instance name? Because the instance name takes the server name

3 answers

4

Check two things through SQL Server Management Studio:

Security Connections

Since it is SQL Server Express, you may need to specify the instance name:

Data Source=192.168.1.1\SQLEXPRESS;
Initial Catalog=banco;
User ID=sa;
pwd=senha;
MultipleActiveResultSets=True;
Connection Reset=True;
Connection Lifetime=600

0

Solved. It was the firewall . although the sql input rules are correct , after the server shutdown it occurred . We disabled the firewall and it worked.

-1

Try it this way:

data source=Máquina\Instancia;
initial catalog=Nome_Banco;
persist security info=True;
user id=usuario;
password=senha;
MultipleActiveResultSets=True;
App=EntityFramework" 
providerName="System.Data.SqlClient"

That way with me, I’ve never been on hand. Copy this string and change it to your need and try.

Browser other questions tagged

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