Arun
Arun

Reputation: 738

provider named pipes provider error 40 - could not open a connection to sql server 2008

SQL Server Name : ECARE432
Instance Name : SQLEXPRESS

app.config contains:

<connectionStrings>
   <add name="TimeTracker.Properties.Settings.myecareConnectionString"  
        connectionString="Data Source=ECARE432;Initial Catalog=myecare;Persist Security Info=True;User ID=sa;Password=ecare123@" 
        providerName="System.Data.SqlClient"/>
</connectionStrings>

I have developed my first application in WPF (C#) with VS 2008 & SQL Server 2008. It works fine on my system. After deployment, it doesn't work on other systems.

It shows the following error message.

provider named pipes provider error 40 - could not open a connection to sql server 2008

I have gone through Google and done the following steps but no use.

  1. Configuration Tools -> SQL Server Configuration Manager -> SQL Native Client Configuration Aliases -> Alias Name -> ECARE432,1433, Port Number -> 1433, Protocol -> TCP/IP, Server Name -> ECARE432
  2. TCP/IP is enabled. Protocols -> TCP/IP Properties -> IP1 -> Active - Yes Enabled - Yes, IP Address - My system IP address, TCP Dynamic Ports - Blank, TCP Port - 1433
    • IP2 -> Active - Yes, Enabled - Yes, IP Address - 127.0.0.1, TCP Dynamic Ports - Blank, TCP Port - 1433
    • IPALL -> TCP Dynamic Ports - Blank, TCP Port - 1433
  3. SQL Server Browser is running.
  4. Server Name is correct. No typo mismatch.
  5. Client machine is able to ping my machine. (PING ECARE432 is working)
  6. TCP 1433 and UDP 1434 Exception added to Firewall. Also Turned off the Firewall in both my system and the client system.
  7. sqlbrowser.exe is added to the Firewall Exception List.
  8. Allow Remote Connections enabled under Connections in SQL Server Properties.
  9. Visual Studio --> Tools --> Options --> Database Tools --> Data Connections --> Changed "SQL Server Instance Name" from sqlexpress to blank.

Please guide me how to fix this issue.

Upvotes: 1

Views: 14760

Answers (1)

marc_s
marc_s

Reputation: 754963

If you have SQL Server Name: ECARE432 and Instance Name : SQLEXPRESS - then you need to use ECASE432\SQLEXPRESS as the value for your Data Source= in your connection string:

<connectionStrings>
   <add name="TimeTracker.Properties.Settings.myecareConnectionString"  
        connectionString="Data Source=ECARE432\SQLEXPRESS;Initial Catalog=myecare;Persist Security Info=True;User ID=sa;Password=ecare123@" 
        providerName="System.Data.SqlClient"/>
</connectionStrings>

Along the same lines - if your instance really is called SQLEXPRESS - then why are you doing this??

Visual Studio --> Tools --> Options --> Database Tools --> Data Connections --> Changed "SQL Server Instance Name" from sqlexpress to blank.

Makes no sense at all. If the instance is in fact SQLEXPRESS - let it be!

Upvotes: 2

Related Questions