OLEDB Connection to Azure SQL fails: Named Pipes Provider: Could not open a connection to SQL Server - azure-sql-database

We have an application that connects to an Azure SQL database with a connection string like
Server={ServerNameHere}.database.windows.net;Database={DatabaseNameHere};etc.....
Our application normally connects using TCP/IP, and the same connection string works perfectly fine from several other machines. Just not for this one client PC.
The error it returns is
A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessable. Check [etc]
followed by:
Named Pipes Provider: Could not open a connection to SQL Server [53].
This is the bit I don't understand. Our connections are made over TCP/IP so why is it showing a message that mentions Named Pipes Provider?
The fact that the connection to the same database, with the same credentials, works fine from other client PCs leads me to think that the problem is not at the Server end (Azure).
But if it's at the client end. What do I need to look for on the Client PC?

I am having asp.net app and I try to connect my Azure SQL database to my app by using my connection string.
Connection String:
Server=tcp:<server>.database.windows.net,1433;Initial Catalog=<db>;Persist Security Info=False;User ID=<username>;Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
I try to connect to database but I got below error:
In my case at that time, I connected to my office Lan network I removed that, and I connected to my personal hotspot and tried again it connected successfully.
The error regarding Named Pipes Provider enable Named Pipes in SQL server configuration manager.
SQL server configuration manager-->SQL Native Client-->Client Protocols-->Named Pipes
It may reduce the error.

Related

Cannot connect to ANY remote SQL Servers from my system

I cannot connect to any remote SQL Server instances from my system. I used to connect them from SQL Server Management Studio. Moreover, I can still connect to the same SQL Servers remotely from another systems (my colleagues' system).
I am getting following error:
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) (.Net SqlClient Data Provider)
Error Number: 53
Severity: 20
State: 0
I have checked:
Named pipes/TCP is enabled.
Remote connections are allowed.
Windows Firewall is off.
Enabled everything in SQL Server Configuration Manager.
Also, I have tried everything mentioned in this post-
How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?
But still could not solve my problem. Please suggest any method which allows me to fix this error and connect to the remote servers again.
instead of check whether that server system is working or not, because sometimes if the server system is not working means we are unable to connect to that system

Can Not connect to Remote SQL server named instance with port

Hi All We have a server where we have sql server 2008 as well as SQL server 2005 hosted on port 1444. Using SSMS, I am able to connect to 2008 instance without any problem. But when I try to connect to 2005 instance using following connection settings.
DEVDB1\SQL_2005,1444
SQL server authentication user name and password.
I get following error
"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: TCP
Provider, error: 0 - A Connection attempt failed because the connected
party did not properly respond after a period of time, or established
connection failed because connection host has failed to
respond)(Microsoft SQL Server, Error: 10060)"
I am able to connect to another instance on the same server. but not this.
NOTE: My colleagues are able to connect to this sql server with the same settings. It just does not work from my machine. Me and all my colleagues are working on VPN and have same machine configuration.
Is there any setting that I need to do/check to get successfully connected?
My VPN user profile was restricting access to this perticular port. Once my VPN user profile is matched with those who were able to access, the problem resolved.

Working with SQL Azure from Starbucks

I have a SQL Azure database. For some reason, I can work with it when I'm at home, but not when I'm at Starbucks. I can successfully login to it and "manage" it via the web-based tool provided from the Windows Azure Portal. However:
When my web app tries to hit the database, I receive an error that says:
The provider did not return a ProviderManifestToken string.
When I try to hit the database from SQL Management Studio, I receive the following error:
Cannot connect to tcp:[serverName],[number].
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: TCP
Provider, error: 0 - A connection attempt failed because the connected
party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond.)
(Microsoft SQL Server, Error: 10060)
I know my IP Address is unblocked, because as mentioned, I can use the web-based tool. I know the database is setup properly, because I can use it from home. However, when I seem to try to work from any local coffee shop, I'm stuck.
Thanks
the Web based Azure Portal doesn't use your local IP address to connect to your databases, it uses the ip address of the server hosting the portal.
since you're getting a new IP from coffee shops, either you add that in the Azure SQL Firewall or you open up your Azure SQL to all IPs.
if that doesn't work, then maybe your local coffee shop has firewall setting blocking port 1433...

VB.NET application not using failover partner

I have a VB.NET app that connects to a SQL Server.
We recently added database mirroring in case of a server failure.
Well of course, our SQL Server failed but the VB.NET app is not failing over.
I found that in our code, a failover partner wasn't specified in the connection string so I updated the connection string as follows:
sConnectionString = "Data Source=PROD-SQL;Failover Partner=FAILOVER-SQL;Initial Catalog=DB;User ID=****;Password=******;"
The SqlClient.SqlConnection object accepts this connection string but when I call its .Open() command it fails with the following error:
"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)"
Why is this? Our intranet apps failed over just fine (Classic ASP using DSN-less connections).
Does the application have to make at least one successful initial connection to the primary server before it can failover successfully?
Thanks!
Run this on your principal db
SELECT DB_NAME(database_id) AS 'DatabaseName'
, mirroring_role_desc
, mirroring_safety_level_desc
, mirroring_state_desc
, mirroring_partner_instance
FROM
sys.database_mirroring WHERE mirroring_guid IS NOT NULL;
The value returned in mirroring_partner_instance is the server name that will be used by your connection for failover, not FAILOVER-SQL. FAILOVER-SQL will be used when it first tries to get a connection but cannot contact PROD-SQL. If PROD-SQL is available the failover partner will be set in cache from the sql server value mirroring_partner_instance.
See here for more info: http://blogs.msdn.com/b/spike/archive/2010/12/15/running-a-database-mirror-setup-with-the-sqlbrowser-service-off-may-produce-unexpected-results.aspx

SQL Azure Database Named Pipes Error

Up until last night, my site (hosted by DiscountASP.net) and the SQL Azure database that it connects to were running normally.
For some reason, during the night, the site went down with a named pipe error. Error 40.
Having prefixed the server name with "tcp:" in the connection string, the error is now:
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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)
So, just to be clear, the web.config file did not change at all between the time the website last worked and the item the named pipe error came up.
Now, the username, password and instance name are all correct since the site runs locally against the remote SQl Azure server perfectly.
I've checked the instance name and the SQl Azure access rules, ensuring that the web server's IP address is whitelisted.
Any ideas on whats wrong?
If I understand this right, your local website (on-premise) can connect to SQL Azure, but your website deployed in Azure can't?
Make sure your firewall rules has the "allow other windows azure services to access this server". Checking this option off basically prevents any azure-hosted application/service from connecting to your database.