The underlying provider failed on open

Introduction

I am now providing resolution of The underlying provider failedon open problem whenever we are working on across the network. If you see inner exception message then you'll caught in below error description in detail. This problem comes often when we are working with Entity Framework with MVC, ASP.Net, Windows Forms, WPF etc. This issue can be encountered in noticed scenarios. I've also written in detail associated with issue Could not open a connection to SQL Server.

Error Description

{"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)"}

Step 4: Now you will see Local DTC Properties window and click on Security tab, under Transaction Manager Communication section tick option Allow Inbound and Allow Outbound and then finally click on OK button.

if above Four steps does not work for you then I am throwing shade of my previous article on error Could not open a connection to SQL Server which explains step by step with great description, I am listing main steps here also.

Check for SQL Server (MSSQLSERVER) service whether it's running or

Check for SQL Server Browser service to running fine.

Check for Aliases.

Check for SQL Server Default Port 1433 is existing or not.

Check for Allow remote connections to this server.

Ping for your IP Host Address whether it is responding or not.

You can check for Windows log detail tying in quick window EVENTVWR to investigate into issue very closely.

Observations

No 1: Server Machine While in Sleep Mode

Sometimes, The underlying provider failed on open also happens when your machine/server goes into sleep mode, so avoid your machine/server not switch to sleeping mode.

No 2: Low Internet Accessibility

This week , I faced a new scenario because Internet accessibility was very low and server was sending timeout due to low internet accessibility, it was throwing error The underlying provider failed on open, this error comes in so many different ways whenever using Entity Framework in our application.

Summary

I have provided above two approaches to resolve the error The underlying provider failed on open, if you still doesn't resolve this issue, you can write your error with detail so can help you accordingly.

Hey, there! Thanks for your article. I'm working on a mobile app which makes a lot of transactions with the database through Web API, when you load the app or login it synchronizes all data from an to the server. The problem is that, because it makes a lot of requests, especially having in mind that after each item is synchronized the last update date is changed at the server, and there is an authentication filter, maybe the database can't handle all of that stuff easily. Since the database is in an external server and I don't have easy access to the machine configuration, I want to ask first: do you think that doing the Local DTC change will help me?

I have the same exception but it's random. The only way to fix it is to restart the server.What could the cause be?

System.Data.Entity.Core.EntityException The underlying provider failed on Open. Void MoveNext()InvalidOperationException Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. System.Exception ExceptionWithStackTrace(System.Exception)