ASP web application could not connect to remote server - sql-server

I have classic asp web application on server 2012. It throws error saying could not connect to SQL server.
Error: A network related or instance- specific error occurred while establishing the 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.
When I checked SQL configuration manager, Shared memory, TCP/IP & Named Pipes are all enabled. And also when I run queries on that server, all queries are executed successfully. But when trying to connect itself, it could not connect to server. My connection string is correct. Please help me.

Related

Unable to connect to SQL Server from Excel to generate reports. Named pipes and tcp/ip are enabled. using trusted connection

Trying to connect to SQL Server from Excel by using >>Data tab, >>From other sources >> from SQL server. It came back with the attached message
I made sure named pipes and TCP/IP are enabled in the SQL server configuration manager. It works on my laptop. But my friend is trying to install in her laptop and it is not working. Appreciate any ideas you can share with us. We are doing Developer Edition, custom install of the database server. Double checked the instance name and made sure remote connection is allowed.
This is the error message I get
Unable to connect:
We encountered an error when trying to connect.
Details : Microsoft SQL: 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 if the instance name is correct and SQL server is configured to allow remote connections. (Provided:Named Pipes Provider,error:40 Could not open a connection to SQL Server.

HTTP Error 500.30 - ANCM In-Process Start Failure - An error occured during migration

I have read this thread, however unfortunately couldn't find the solution to my problem. I have an ASP.Net Core project (that's called Rent) and it works without any problem on my local machine. However, once I publish the project to the IIS (still in development mode) I get the below error
fail: Rent.Program[0]An error occured during migration
Microsoft.Data.SqlClient.SqlException (0x80131904): 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: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.
---> System.ComponentModel.Win32Exception (0x89C50118): Unknown error (0x89c50118)
The connection string is called DefaultConnection and is the environment variable. Can anyone help me please? Can provide any additional information if required.
The first thing you should check is that your SQL Server instance is up and running and that your database is still available. This error means quite literally that it can't establish a connection to SQL Server from the Secret Server application.
And you can also check follow things in your environment:
Is something blocking the connection between your Secret Server server and SQL Server?
The standard SQL port is 1433. Check with your server administrator - is the Windows Firewall in use, blocking this port on your SQL server? Check with your network administrator - is there a firewall at some point in between that has closed off this port? Keep in mind that if you use a custom port for SQL, it need to be specified the Secret Server database connection using a SQLSERVER,port type of format.
On the server hosting your SQL Server database, is the SQL Server
service running?
Open services.msc or SQL Configuration Manager to view the status of your SQL Server service.

UWP cannot connect to local SQL Server

I'm creating a simple UWP application working together with my local DB server I set up with SQL Server Management Studio.
I can successfully set up a connection in the server explorer and run queries in the DB:
However when I run the application I get an error when the connection is being established:
System.Data.SqlClient.SqlException HResult=0x80131904 Message=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: SQL Network Interfaces, error: 25 - Connection string is not valid) Source=Core .Net SqlClient Data Provider
I'm not sure if it's a problem with the connection string or what else it could be. I checked the firewall settings and everything seems to be fine. The SQL server settings also allow for remote connection.
Which SQL Server version is running?
Have you tried with the following connection string format?
Data Source=.\\MSSQLServer;Initial Catalog=PapaDario;Trusted_Connection=yes;
Before you connect to your database, some aspect of the SQL Server configuration needs to be changed. First, ensure that you've enabled TCP/IP for SQL Server. You can do that in the Computer Management console. Then make sure that your SQL Server Browser service is running.

No process is on the other end of the pipe error when trying to connect to SQL Server database through VB.NET application

I have a SQL Server database which I connect to from my VB.net client application.
Everything works fine in most of the systems. But in a few new VMs the client application is unable to connect to SQL Server and it throws the error mentioned below. The strange thing is that I can use the same credentials (SQL Server authentication) to connect through SQL Server Management Studio in the same system.
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)
The sample connection string used is as below
Data Source=[server name];Initial Catalog=[db name];Persist Security Info=True;User ID=[username];Password=[pass]
I have checked similar answers and have already tried the following
Made sure SQL Server is accepting remote connections
Made sure TCP and Named Pipes are enabled in SQL Server
Started SQL Server Browser service
Tried specifying IP address instead of server name
By reading related articles, some of them point eventually to SSH, TLS1.1 and TLS1.2 issues. I also suspect firewall, but because I do not have admin rights to the system, I am not able to check the inbound and outbound rules.
Any suggestions would help.

Local IIS Web server cannot connect to SQL Server

When I use the local IIS Web server, my ASP.NET MVC application is unable to connect to SQL Server. The database is on another server. However, if I use the Visual Studio Development Server, it works just fine.
Anyone know what settings I'm missing? Should something change in my Web.config?
Yes, TCP/IP is enabled on SQL Server.
Here is the error I get -
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)
Here is my connection string -
connectionString="
SERVER=servername;
Initial Catalog=dbname;
User ID=userid;
Password=passwd"
providerName="System.Data.SqlClient"
I think you need to use IP address to connect remote database something like SERVER=59.230.212.12 in connection string. Try to connect database in management studio from where your IIS is installed . then use same setting in connection string .

Resources