SQL Server Shared Memory communication protocol usage

I read a lot of articles and answers of similar topics over the internet but didn't find the reason for my problem.

I have a .NET 4 Windows Service connecting to SQL Server Express on the same machine. Only one time in production it happened to see the following error:

"A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)".

The reason for having this error is clear if we use named pipes protocol because we haven't enabled them on the server. But my question here is why named pipes protocol could be used here? In the connection string we have used "Data Source=.\SQLEXPRESS". Having in mind the information in msdn and over the internet my understanding is that when "." is used always the "Shared Memory Protocol" must be used. So what must happen so that ADO.NET SqlClient decides to use Named Pipe Protocol instead?

Most of the times everything is working just fine, but I need to know the process so that we can prevent any further errors of this type if needed.

Thanks in advance, Тодор

5
задан klashar 9 March 2017 в 13:23
поделиться