Error Cannot Connect to Server - A network-related or instance-specific error

0 votes

I get the following error when trying to connect to SQL Server:

Cannot connect to 108.163.224.173.

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) (Microsoft SQL Server, Error: 1326)

This error is thrown when I try to configure my database to gridview in Visual Studio 2020. I'm at a loss as to how to debug this error.

How would you debug this error? What steps should I take in order to determine what is really going on here, in addition to the one mentioned in the error message?

Jul 21, 2020 in PHP by kartik
• 37,510 points
28,130 views

2 answers to this question.

0 votes

Hello @kartik,

Follow the steps below :

  1. Open "SQL Server Configuration Manager"
  2. Now Click on "SQL Server Network Configuration" and Click on "Protocols for Name"
  3. Right Click on "TCP/IP" (make sure it is Enabled) Click on Properties
  4. Now Select "IP Addresses" Tab -and- Go to the last entry "IP All"
  5. Enter "TCP Port" 1433.
  6. Now Restart "SQL Server .Name." using "services.msc" (winKey + r)

Hope it works!!

If you need to know more about network-related or instance-specific errors, it is recommended that you go for the SQL Certification Course.
ThanK you!!

answered Jul 21, 2020 by Niroj
• 82,880 points
Thanks for this..

Hello Friends,

I am the facings issue in connecting local database.

Error:

TITLE: Connect to Server
------------------------------

Cannot connect to DESKTOP-JQ2TJQV.

------------------------------
ADDITIONAL INFORMATION:

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) (Microsoft SQL Server, Error: 2)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476

------------------------------

The system cannot find the file specified

------------------------------
BUTTONS:

OK
------------------------------

Anyone please help me on the above ?

Regards,

Vanitha


0 votes

Hello,

The "sql server error 40" is appears mostly when SQL Server does not allow remote connections, Firewall Settings or TCP/IP is not enabled. You need to do some troubleshoots to determine where is the issue.

Some fast steps are:

  1. Check SQL Server is running
  2. Make sure that Allow Remote Connections is enabled on sql server properties
  3. Check if TCP/IP is enabled
  4. Configure to allow SQL Server in Firewall Settings
  5. Check for working fine SQL Server Browser
  6. Make sure that you can ping the SQL Server
You can also check step by step explained above steps on the following article here.
Thnx
answered Aug 18, 2020 by Fantazma
• 140 points

Related Questions In PHP

0 votes
1 answer

Error: Can't connect to MySQL server on 'my.application.com' (10061)

Hello @kartik, To directly login to a remote ...READ MORE

answered Aug 19, 2020 in PHP by Niroj
• 82,880 points
1,721 views
+1 vote
1 answer

ERROR: Cannot add or update a child row: a foreign key constraint fails

Hello @kartik, You are getting this constraint check ...READ MORE

answered Aug 20, 2020 in PHP by Niroj
• 82,880 points
29,327 views
0 votes
0 answers

PHPMailer SMTP ERROR: Failed to connect to server

This Code: <?php include("class.phpmailer.php"); include("class.smtp.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // ...READ MORE

Jun 27, 2022 in PHP by narikkadan
• 63,420 points
1,668 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
21,756 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
2,647 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
2,506 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
41,381 views
0 votes
1 answer

Error:Cannot connect to database server Communications link failure

Hello @kartik, Setting the bind-address to the server's network IP ...READ MORE

answered Aug 19, 2020 in PHP by Niroj
• 82,880 points
986 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP