The most common cause of this issue is that the SQL Server service is not running, or there are network-related problems such as firewall settings blocking the connection or incorrect SQL Server configuration. Additionally, it might be due to incorrect connection strings or instance names in your application setup.
1. Gather Information About the Instance of the SQL Server.
In this section, we will discuss ways to check whether the instance of the SQL Server is working or not, along with methods to fix it, if it is not working.
Step 1. Check if an Instance of SQL Server is Installed and is Working or Not
First of all, log in to the computer hosting the SQL server instance. Now, follow these steps to open Services in Windows. Now, check if the database engine has been configured to accept remote connections. To check this, follow these steps:
Step 2. Obtain the IP address of the computer
Step 3. Get the TCP port number used by the SQL server
Method 2: Enabling protocols for port 1433
Connecting to the “Database Engine” from another computer is not allowed in many “SQL Server” implementations unless an administrator utilizes “Configuration Manager” to allow it.
Method 3: Create a Firewall exception
Sometimes the Windows firewall turns on and blocks links from another computer.
Method 4: Check Local Connection
One of the reasons for this error is providing the wrong server name, which will result in an error. As seen in the figure below, the provided server name is “DESKTOP-UD88TLT1” whereas the accurate server name is “DESKTOP-UD88TLT”. So it will be unable to connect to the server, which will result in an error “cannot connect to server”. This is the most basic reason for error, so we should check it first if working locally. The error arises while locally connecting to SQL server with the wrong server name. In case you are using the express edition, following your server name, add “\SQLEXPRESS” as seen in the figure below.




















