System.Data.SqlClient.SqlExceptionExtensions.IsNamedPipeConnectionError C# (CSharp) Method

IsNamedPipeConnectionError() private static method

private static IsNamedPipeConnectionError ( SqlException exception ) : bool
exception SqlException
return bool
        private static bool IsNamedPipeConnectionError(SqlException exception)
        {
            // See http://blogs.msdn.com/b/sql_protocols/archive/2007/05/16/named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error-xxx.aspx
            return exception.Class == 20 && (
                                                exception.Number == 2 ||    // The system cannot find the file specified
                                                exception.Number == 53 ||   // The network path was not found
                                                exception.Number == 233 ||  // No process is on the other end of the pipe
                                                false);
        }