SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )

Regular readers of my blog are aware of the fact that I have written about this subject umpteen times earlier, and every time I have spoken about a new issue related to it. Few days ago, I had redone my local home network. I have LAN setup with wireless router connected with my four computers, two mobile devices, one printer and one VOIP solution. I had also formatted my primary computer and clean installed SQL Server 2008 into it. Yesterday, incidentally, I was sitting in my yard trying to connect SQL Server located in home office and suddenly I stumbled upon the following error. Finding the solution was the most infuriating part as it consumed my precious 10 minutes.

Let us look at few of the common errors received:

An error has occurred while establishing a connection to the server.

(provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5)

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1326)

I eventually found the resolution to this error on this blog itself; so I was saved from hunting for the solution. I am sure there are a number of developers who had previously fixed this error while installing SQL Server 2008 or SQL Server 2005 but in due course forgot the right solution to this error. This is just a quick refresher. Make sure to bookmark this as you never know when you would need this solution.

Let us check into the steps to resolve this error.

1) SQL Server should be up and running.

Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Server Configuration Manager >> SQL Server Services, and check if SQL Server service status is “Running”.

In addition, ensure that your remote server is in the same network. Run “sqlcmd -L” in your command prompt to ascertain if your server is included in your network list. You can even find tutorial for the same here SQL SERVER – Find All Servers From Local Network – Using sqlcmd – Detect Installed SQL Server on Network.

I have confronted numerous situations when these nerve-wracking errors crop up, and most of the time when I try to troubleshoot I notice that SQL Server services are neither running nor installed. If SQL Server is not installed as default instance SQL Server Browser should be running together with it; we will explore this further in Topic 5.

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_7

2) Enable TCP/IP in SQL Server Configuration

When two or more SQL Servers are connected across network they do all communication using TCP/IP. The default port of SQL Server installation is 1433. This port can be changed through SQL Server Configuration Manager. TCP/IP should be enabled for SQL Server to be connected.

Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Server Configuration Manager >> Select TCP/IP

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_1

Right Click on TCP/IP >> Click on Enable

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_2

You must restart SQL Server Services for all the changes to take effect. Right click and go to menu properties to select location where default port of SQL Server can be changed.

3) Open Port in Windows Firewall

Windows Firewall is very efficacious in protecting the Operating system from all sorts of malicious attacks. By default, many of the ports and services are refrained from running by firewall. Time and again, SQL Server ports are not open in firewall as well. All the ports on which SQL Server is running should be added to exception and firewall should filter all the traffic from those ports. As described, by default SQL Server runs on port 1433, but if default port is changed then the new port should be added to exception. If SQL Server has named instance (another instance besides default instance) is installed, SQL Server browser should also be added to the exception, as described in Step 7.

Go to Control Panel >> Windows Firewall >> Change Settings >> Exceptions  >> Add Port

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_3

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_4

Make the following entries in popup “Add a Port” and click OK.
Name : SQL
Port Number: 1433
Protocol: Select TCP

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_5

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_6

4) Enable Remote Connection

Enabling remote connection is another important, yet oft-neglected step that is frequently missed by database administrators while setting up SQL Server. If this feature is turned off SQL Server will function smoothly on local machine, but it will let another server connect to it remotely. By default this feature is ON in SQL Server 2008.

Right click on the server node and select Properties.

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_9

Go to Left Tab of Connections and check “Allow remote connections to this server”

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_10

5) Enable SQL Server Browser Service

If SQL Server is not installed as default instance but instead installed as named instance and also if there is no specific TCP/IP port configured, it will give rise to the error that is being discussed in this article. If SQL Server Browser service is enabled, it will allow the server to be connected through dynamic TCP/IP port. Enabling this service is a one-time process, as on enabling it once it will apply to all the instances installed on the same server.

Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Server Configuration Manager >> SQL Server Browser

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_8

Right Click on SQL Server Browser >> Click on Enable

6) Create exception of sqlbrowser.exe in Firewall

As elucidated in Step 6, sqlbrowser service needs to be enabled for named instance. Windows Firewall may prevent sqlbrowser.exe to execute. So, it is imperative to add exception for the same in windows firewall.

Search for sqlbrowser.exe on your local drive where SQL Server is installed. Copy the path of the sqlbrowser.exe like C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe and create the exception of the file in Firewall, as delineated in Step 3.

7) Recreate Alias

It is getting quite common to create alias of SQL Server and use it in application. This will ensure that in future if any physical SQL Server has to be moved, it will not be required to change any code or connection string. You can simply create alias with the same name pointing to different SQL Server and it will start working instantaneously. I have observed that a couple of times due to internal error while recreating alias this error was fixed.

Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Native Client 10.0 Configuration >> Aliases

Delete the alias that is giving problem and recreate it with identical parameters.

SQL SERVER - FIX : ERROR : (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) e40_11

I have tried my best to include all the methods of fixing this error and if I have missed any, please leave a comment and I will be very glad to include them here. I have put in my effort to encompass this issue in one article that needs to be refereed when any connection error comes up.

Watch SQL in Sixty Seconds video to Resolve Connection Error:

[youtube=http://www.youtube.com/watch?v=1k00z82u4OI]

Reference : Pinal Dave (https://blog.sqlauthority.com)

SQL Error Messages, SQL Scripts, SQL Server Management Studio
Previous Post
SQL Server – Download PDF SQL Server Cheat Sheet
Next Post
SQLAuthority News – SQL Server Energy Event with Rushabh Mehta – May 20, 2009

Related Posts

658 Comments. Leave new

  • Thanks! you saved the day!

    Reply
  • Thanks a lot! u are superb… tumbs Up for U sir, Salute

    Reply
  • Thanks a lot! I solved the error with SQL server but i have another problem to connect to a database in local server. If you can solve it send me answer.

    Reply
  • Thanks

    Reply
  • I get this error intermittently. Seems to work sometimes and not others. I have a job scheduled through SQL Server Agent to run every 4 hours. When I view the history the odd one or two have failed for this reason?

    Reply
  • Pinal Dave,you are great!!!

    Reply
  • Another reason is SQL server only allows windows auth, change it to mixed mode from SQL server properties.

    Reply
  • Thank you! The SQL Server browser service had been disabled for me… you sorted it in 2 mins.

    Reply
  • Am using Windows 8.1 and SQL Server Version is 2012, I am Getting the Error Message as Below.

    “TITLE: Connect to Server
    ——————————

    Cannot connect to XXXX

    ——————————
    ADDITIONAL INFORMATION:

    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) (Microsoft SQL Server, Error: 5)

    For help, click:

    ——————————

    Access is denied

    Kindly Help me to Solve this Problem

    Reply
  • @Pinal Dave, thank you very much for this article. I had the same error, and by following each of your steps, I was able to finally remotely login to my MS SQL Server Express instance. Much appreciated.

    Reply
  • Shyamaprasad Sarkar
    February 3, 2016 2:08 pm

    Hi Pinal,

    I am having a problem to connect to remote database server 2014 instance from my local system, where as I can connect to the 2008R2 version on the same server.

    I am getting this error below:
    TITLE: Connect to Server
    ——————————
    Cannot connect to xx.xxx.xxx.xxx\MSSQL2014.
    ——————————
    ADDITIONAL INFORMATION:
    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: 26 – Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)
    ——————————————————————————————————————————–

    Please suggest.

    Thanks you,

    Shyamaprasad Sarkar

    Reply
  • Unfortunatelly Configuration manager in windows 8.1 cant update values ,you can see only you cant modify ,. so problem is impossible to be solved if you have windows 8.1

    Reply
  • krishan kumar
    March 16, 2016 5:32 pm

    TITLE: Connect to Server
    ——————————

    Cannot connect to KK.

    ——————————
    ADDITIONAL INFORMATION:

    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) (Microsoft SQL Server, Error: 2)

    sir when i installed second instance in sql server2012 my first one is giving error.

    Reply
  • Hi Pinal Sir,
    Thanks for this article. My problem was resolved after creating the alias.

    Reply
  • I am creating a WPF Application in development server . After deployment it is running perfectly fine on local host but not fetching data from database present in the development server when hosted on web . I tried all the methods listed but did not fructify .I do not want to spam the page but being a newbie I do not have any other choice . Please help me. I am getting following error :

    Version=1.0.0.0, Culture=neutral, PublicKeyToken=c53b2ec5ef7ecebc, processorArchitecture=msil/Assembly_Area.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c53b2ec5ef7ecebc, processorArchitecture=msil, type=win32

    System.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: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)
    —> System.ComponentModel.Win32Exception (0x80004005): The network path was not found

    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
    at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
    at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
    at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
    at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
    at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
    at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
    at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
    at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
    at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
    at System.Data.SqlClient.SqlConnection.Open()
    at Assembly_Area.Page1.textbox2_TextChanged(Object sender, TextChangedEventArgs e)
    at System.Windows.Controls.TextChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
    at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
    at System.Windows.Controls.Primitives.TextBoxBase.OnTextChanged(TextChangedEventArgs e)
    at System.Windows.Controls.Primitives.TextBoxBase.OnTextContainerChanged(Object sender, TextContainerChangedEventArgs e)
    at System.Windows.Controls.TextBox.OnTextContainerChanged(Object sender, TextContainerChangedEventArgs e)
    at System.Windows.Documents.TextContainerChangedEventHandler.Invoke(Object sender, TextContainerChangedEventArgs e)
    at System.Windows.Documents.TextContainer.EndChange(Boolean skipEvents)
    at System.Windows.Documents.TextContainer.System.Windows.Documents.ITextContainer.EndChange(Boolean skipEvents)
    at System.Windows.Documents.TextRangeBase.EndChange(ITextRange thisRange, Boolean disableScroll, Boolean skipEvents)
    at System.Windows.Documents.TextRange.System.Windows.Documents.ITextRange.EndChange(Boolean disableScroll, Boolean skipEvents)
    at System.Windows.Documents.TextRange.ChangeBlock.System.IDisposable.Dispose()
    at System.Windows.Documents.TextEditorTyping.DoTextInput(TextEditor This, String textData, Boolean isInsertKeyToggled, Boolean acceptControlCharacters)
    at System.Windows.Documents.TextEditorTyping.TextInputItem.Do()
    at System.Windows.Documents.TextEditorTyping.ScheduleInput(TextEditor This, InputItem item)
    at System.Windows.Documents.TextEditorTyping.OnTextInput(Object sender, TextCompositionEventArgs e)
    at System.Windows.Controls.Primitives.TextBoxBase.OnTextInput(TextCompositionEventArgs e)
    at System.Windows.UIElement.OnTextInputThunk(Object sender, TextCompositionEventArgs e)
    at System.Windows.Input.TextCompositionEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
    at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
    at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
    at System.Windows.Input.InputManager.ProcessStagingArea()
    at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
    at System.Windows.Input.TextCompositionManager.UnsafeCompleteComposition(TextComposition composition)
    at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
    at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
    at System.Windows.Input.InputManager.ProcessStagingArea()
    at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
    at System.Windows.Input.TextCompositionManager.UnsafeStartComposition(TextComposition composition)
    at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
    at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
    at System.Windows.Input.InputManager.ProcessStagingArea()
    at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
    at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
    at System.Windows.Interop.HwndKeyboardInputProvider.ProcessTextInputAction(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
    at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
    at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
    at System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled)
    at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.Run()
    at System.Windows.Application.RunDispatcher(Object ignore)
    at System.Windows.Application.StartDispatcherInBrowser(Object unused)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    at System.Windows.Threading.DispatcherOperation.InvokeImpl()
    at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Windows.Threading.DispatcherOperation.Invoke()
    at System.Windows.Threading.Dispatcher.ProcessQueue()
    at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.Run()
    at System.Windows.Application.RunDispatcher(Object ignore)
    at System.Windows.Application.StartDispatcherInBrowser(Object unused)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    at System.Windows.Threading.DispatcherOperation.InvokeImpl()
    at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Windows.Threading.DispatcherOperation.Invoke()
    at System.Windows.Threading.Dispatcher.ProcessQueue()
    at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    ClientConnectionId:00000000-0000-0000-0000-000000000000
    Error Number:53,State:0,Class:20

    ———————–

    PresentationHost.exe v4.0.41210.0 built by: Main – C:WindowsSysWOW64PresentationHost.exe
    ntdll.dll v6.3.9600.18217 (winblue_ltsb.160124-0053) – C:WindowsSYSTEM32ntdll.dll
    KERNEL32.DLL v6.3.9600.18217 (winblue_ltsb.160124-0053) – C:WindowsSYSTEM32KERNEL32.DLL
    KERNELBASE.dll v6.3.9600.18217 (winblue_ltsb.160124-0053) – C:WindowsSYSTEM32KERNELBASE.dll
    SYSFER.DLL v12.1.5337.5000 – C:WindowsSYSTEM32SYSFER.DLL
    ADVAPI32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32ADVAPI32.dll
    USER32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32USER32.dll
    msvcrt.dll v7.0.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32msvcrt.dll
    ole32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32ole32.dll
    OLEAUT32.dll v6.3.9600.17560 – C:WindowsSYSTEM32OLEAUT32.dll
    mscoree.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32mscoree.dll
    SHLWAPI.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32SHLWAPI.dll
    WININET.dll v11.00.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32WININET.dll
    urlmon.dll v11.00.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32urlmon.dll
    SHELL32.dll v6.3.9600.17031 (winblue_gdr.140221-1952) – C:WindowsSYSTEM32SHELL32.dll
    sechost.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32sechost.dll
    RPCRT4.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32RPCRT4.dll
    GDI32.dll v6.3.9600.18155 (winblue_ltsb.151204-0600) – C:WindowsSYSTEM32GDI32.dll
    combase.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32combase.dll
    iertutil.dll v11.00.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32iertutil.dll
    USERENV.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32USERENV.dll
    SspiCli.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32SspiCli.dll
    profapi.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32profapi.dll
    CRYPTBASE.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32CRYPTBASE.dll
    bcryptPrimitives.dll v6.3.9600.18154 (winblue_ltsb.151203-0600) – C:WindowsSYSTEM32bcryptPrimitives.dll
    IMM32.DLL v6.3.9600.17415 (winblue_r4.141028-1500) – C:Windowssystem32IMM32.DLL
    MSCTF.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32MSCTF.dll
    shcore.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32shcore.dll
    PresentationHost_v0400.dll v4.0.30319.33440 built by: FX45W81RTMREL – C:WindowsMicrosoft.NETFrameworkv4.0.30319WPFPresentationHost_v0400.dll
    MSVCR120_CLR0400.dll v12.00.51732.34292 built by: FX452RTMGDR – C:WindowsSYSTEM32MSVCR120_CLR0400.dll
    VERSION.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32VERSION.dll
    PSAPI.DLL v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32PSAPI.DLL
    kernel.appcore.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32kernel.appcore.dll
    uxtheme.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:Windowssystem32uxtheme.dll
    clbcatq.dll v2001.12.10530.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32clbcatq.dll
    CRYPTSP.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32CRYPTSP.dll
    rsaenh.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:Windowssystem32rsaenh.dll
    bcrypt.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32bcrypt.dll
    ieproxy.dll v11.00.9600.18052 (winblue_ltsb.150910-0600) – C:Program Files (x86)Internet Explorerieproxy.dll
    dwmapi.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:Windowssystem32dwmapi.dll
    Secur32.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32Secur32.dll
    WS2_32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32WS2_32.dll
    NSI.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32NSI.dll
    ondemandconnroutehelper.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32ondemandconnroutehelper.dll
    winhttp.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32winhttp.dll
    mswsock.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:Windowssystem32mswsock.dll
    IPHLPAPI.DLL v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32IPHLPAPI.DLL
    WINNSI.DLL v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32WINNSI.DLL
    DNSAPI.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32DNSAPI.dll
    Comctl32.dll v6.10 (winblue_rtm.130821-1623) – C:WindowsWinSxSx86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.18006_none_a9ec6aab013aafeeComctl32.dll
    dfshim.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32dfshim.dll
    mscoreei.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsMicrosoft.NETFrameworkv4.0.30319mscoreei.dll
    clr.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsMicrosoft.NETFrameworkv4.0.30319clr.dll
    msxml3.dll v8.110.9600.18046 – C:WindowsSystem32msxml3.dll
    actxprxy.dll v6.3.9600.18124 (winblue_ltsb.151109-1247) – C:WindowsSYSTEM32actxprxy.dll
    sxs.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32sxs.dll
    PresentationHostProxy.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32PresentationHostProxy.dll
    mshtml.dll v11.00.9600.17278 (winblue_r2.140815-1500) – C:WindowsSYSTEM32mshtml.dll
    msimtf.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:Windowssystem32msimtf.dll
    msls31.dll v3.10.349.0 – C:WindowsSYSTEM32msls31.dll
    d2d1.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32d2d1.dll
    DWrite.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32DWrite.dll
    dxgi.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32dxgi.dll
    d3d11.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32d3d11.dll
    powrprof.dll v6.3.9600.17031 (winblue_gdr.140221-1952) – C:WindowsSYSTEM32powrprof.dll
    IEFRAME.dll v11.00.9600.18231 (winblue_ltsb.160208-0600) – C:WindowsSYSTEM32IEFRAME.dll
    uiautomationcore.dll v7.2.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32uiautomationcore.dll
    jscript9.dll v11.00.9600.17031 (winblue_gdr.140221-1952) – C:WindowsSYSTEM32jscript9.dll
    windowscodecs.dll v6.3.9600.17669 (winblue_r8.150128-1500) – C:Windowssystem32windowscodecs.dll
    mlang.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:Windowssystem32mlang.dll
    mscorlib.ni.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32mscorlibd03a3ddcd6a395878751c5e90fa16915mscorlib.ni.dll
    System.ni.dll v4.0.30319.34239 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32Systemac12146d9e15d339043098cbc5e1762aSystem.ni.dll
    WindowsBase.ni.dll v4.0.30319.34292 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32WindowsBasececebcf7277f61d483b90fdc71b26f02WindowsBase.ni.dll
    PresentationCore.ni.dll v4.0.30319.34292 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32PresentationCore8b49e122229c383eb630e23464da73a4PresentationCore.ni.dll
    PresentationFramework.ni.dll v4.0.30319.34292 – C:WindowsassemblyNativeImages_v4.0.30319_32Presentatio5ae0f00f#5d32161bf5d462d08f2619f2eaffdd1dPresentationFramework.ni.dll
    wpfgfx_v0400.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsMicrosoft.NETFrameworkv4.0.30319WPFwpfgfx_v0400.dll
    PresentationNative_v0400.dll v4.0.30319.33440 built by: FX45W81RTMREL – C:WindowsMicrosoft.NETFrameworkv4.0.30319WPFPresentationNative_v0400.dll
    System.Xaml.ni.dll v4.0.30319.34292 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32System.Xaml2dbcc4f92bd4f3a6211bc2204d63f861System.Xaml.ni.dll
    clrjit.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsMicrosoft.NETFrameworkv4.0.30319clrjit.dll
    System.Configuration.ni.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32System.Configurationed877d034bac52f84a10916e21740aabSystem.Configuration.ni.dll
    System.Xml.ni.dll v4.0.30319.34281 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32System.Xml1bc5f5d790d9ef39b06c0d987c5f9e6dSystem.Xml.ni.dll
    rasapi32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32rasapi32.dll
    rasman.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32rasman.dll
    rtutils.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32rtutils.dll
    dhcpcsvc6.DLL v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32dhcpcsvc6.DLL
    dhcpcsvc.DLL v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32dhcpcsvc.DLL
    System.Core.ni.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32System.Core4330f0f835d24ab584142cb099ad003bSystem.Core.ni.dll
    crypt32.DLL v6.3.9600.16431 (winblue_gdr.131015-2301) – C:WindowsSYSTEM32crypt32.DLL
    MSASN1.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32MSASN1.dll
    System.Drawing.ni.dll v4.0.30319.36337 built by: FX452RTMLDR – C:WindowsassemblyNativeImages_v4.0.30319_32System.Drawingf9ac9ac932a0fbdb5d47e459256e6e7cSystem.Drawing.ni.dll
    System.Windows.Forms.ni.dll v4.0.30319.34250 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32System.Windows.Forms4c70a3adb718a892a8804a9561be286System.Windows.Forms.ni.dll
    DPAPI.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32DPAPI.dll
    gpapi.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32gpapi.dll
    ncrypt.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32ncrypt.dll
    NTASN1.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32NTASN1.dll
    comctl32.dll v5.82 (winblue_rtm.130821-1623) – C:WindowsWinSxSx86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.9600.17810_none_7c5b6194aa0716f1comctl32.dll
    gdiplus.dll v6.3.9600.18123 (winblue_ltsb.151108-1002) – C:WindowsWinSxSx86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9600.18123_none_dad9a2585bcb0fd8gdiplus.dll
    ntmarta.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32ntmarta.dll
    PresentationFramework.Aero2.ni.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32Presentatioaec034ca#960a6135ca597e7beb2f05c83e44bf1ePresentationFramework.Aero2.ni.dll
    System.Data.ni.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32System.Data5e908827d60728d9164e854bea7efbf5System.Data.ni.dll
    System.Data.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsMicrosoft.NetassemblyGAC_32System.Datav4.0_4.0.0.0__b77a5c561934e089System.Data.dll
    d3d9.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32d3d9.dll
    igdumdim32.dll v10.18.10.4013 – C:WindowsSYSTEM32igdumdim32.dll
    WtsApi32.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32WtsApi32.dll
    WINSTA.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32WINSTA.dll
    PenIMC.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsMicrosoft.NETFrameworkv4.0.30319WPFPenIMC.dll
    wisp.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSystem32wisp.dll
    atlthunk.dll v6.3.9600.17670 (winblue_r8.150129-1500) – C:WindowsSYSTEM32atlthunk.dll
    tpcps.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:Program Files (x86)Common FilesMicrosoft SharedInktpcps.dll
    igdusc32.dll v10.18.10.4013 – C:WindowsSYSTEM32igdusc32.dll
    msctfui.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:Windowssystem32msctfui.dll
    WINMM.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32WINMM.dll
    WINMMBASE.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32WINMMBASE.dll
    cfgmgr32.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32cfgmgr32.dll
    DEVOBJ.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSYSTEM32DEVOBJ.dll
    System.Transactions.ni.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsassemblyNativeImages_v4.0.30319_32System.Transactionsddb7438169a54dd1cf3e7ddaccf93b9cSystem.Transactions.ni.dll
    System.Transactions.dll v4.0.30319.34209 built by: FX452RTMGDR – C:WindowsMicrosoft.NetassemblyGAC_32System.Transactionsv4.0_4.0.0.0__b77a5c561934e089System.Transactions.dll
    System.EnterpriseServices.Wrapper.dll v4.0.30319.33440 built by: FX45W81RTMREL – C:WindowsMicrosoft.NetassemblyGAC_32System.EnterpriseServicesv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.EnterpriseServices.Wrapper.dll
    security.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:Windowssystem32security.dll
    schannel.dll v6.3.9600.16384 (winblue_rtm.130821-1623) – C:WindowsSYSTEM32schannel.dll
    mdnsNSP.dll v3,0,0,10 – C:Program Files (x86)BonjourmdnsNSP.dll
    rasadhlp.dll v6.3.9600.17415 (winblue_r4.141028-1500) – C:WindowsSystem32rasadhlp.dll
    diasymreader.dll v12.0.20806.33440 built by: FX45W81RTMREL – C:WindowsMicrosoft.NETFrameworkv4.0.30319diasymreader.dll

    Reply
  • Sean Perkins
    May 14, 2016 2:28 am

    I just ran into this same problem and after some trial and error I found two things I was missing that weren’t specifically named in your well written document.
    -Make sure named pipes is enabled
    -Make sure you’re typing in the proper service accounts for the Principal, Mirror, & Witness (in my case, I had a different service account for each server…which I forgot about!)

    Reply
  • Thank you so much!!! ☺

    Reply
  • Mahady Hasan Masuk
    June 14, 2016 3:24 pm

    I have sqlserver 2008 r2 and sqlserver 2012 Installed in my pc both are running fine in my pc but when i try to connect sqlserver 2012 database from another computer it’s showing error . When i enable tcp/ip and want to restart then sqlserver not starting event local computer. I change tcp/ip port then it’s connect it local pc but not from another pc .

    Reply
  • Ayotunde Sodipe
    July 22, 2016 6:10 pm

    Pinal,

    I just used your guide to resolve my SQL Server access error 40.

    Thank you very much

    Reply
  • Thanks. I deleted my Aliases and recreated a new one it is worked.

    Reply

Leave a Reply