Showing posts with label pipes. Show all posts
Showing posts with label pipes. Show all posts

Saturday, February 25, 2012

Connection Error from ASP.Net under IIS: provider: Named Pipes Provider, error: 40

We experience the 40 error when our Asp.net code runs under IIS and uses named pipes to a sql server 2005 named instance.

We've tried all suggestions found on blogs and KB articles such as making sure the named pipes protocol is enabled, making sure the Browser service is started, making sure Allow Remote Connections is enabled, making sure we're not using Asp.Net 2.0 membership providers, and the list goes on and on.

We boiled it down to a simple test scenario. We open a SqlConnection to the sql 2005 box in the code with the intention of binding a datareader to a gridview, but it never gets that far because the connection.Open() fails.

If we run this test application as a virtual directory in IIS and Asp.Net 2.0, the connection.Open() fails.

If we run this test application from Visual Studio .Net using Cassini (PWS), the connection.Open() succeeds and binds to the gridview.

What could be causing the connection to fail under IIS but succeed under Cassini? We've tried setting IIS to run as a domain user and with digest authentication enabled. That made no difference.

Any help or insight is appreciated!

Could you try to answer the following questions though some of them may be already implied by your post?

(1) Is this remote connection or local connection?

(2) Is the account that runing your visual studio.net the the same as your IIS. Do you impersonate client connection in IIS?

(3) Can you make direct connection to your backend sqlserver from your virtual studio or sql server management studio?

(4) Can you try connecting using TCP instead? If not, what is the error code?

|||

(1) Is this remote connection or local connection?

-Remote connection

(2) Is the account that runing your visual studio.net the the same as your IIS. Do you impersonate client connection in IIS?

-Same account, windows authentication. No impersonation

(3) Can you make direct connection to your backend sqlserver from your virtual studio or sql server management studio?

-Management Studio works, Cassini works.. IIS does not

(4) Can you try connecting using TCP instead? If not, what is the error code?

TCP gives "server actively refused connection" error

|||

Does your connection string like "servername\instancename" or something else?

The TCP failure indicates either the server TCP listener is not up or client uses different TCP port to connect. So please check whether the TCP is enabled or not. Restart the server after the configuration change. Then check if the connection string has instancename specified. Once you find out which port the server is listening on, you can also use "tcpTongue Tiedervername,port" to connection to the server.

Tuesday, February 14, 2012

Connecting to SQL2000 using DNS Alias/Named Pipes

Hi,
I have a very confusing issue.
I am attempting to connect to a SQL2000 server using Named Pipes and a
DNS Alias without success. I get the sql server does not exist or
access is denied error. I can successfully connect using TCPIP
sockets however.
If I connect to the server using it's own servername I can connect
using Named Pipes or TCPIP sockets.
Any ideas?
Named pipes does not use DNS so a DNS alias will not work with named pipes.
Named pipes uses a broadcast of the NetBios name. Since TCP/IP uses DNS the
connection works.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||rboyd@.onlinemicrosoft.com (Rand Boyd [MSFT]) wrote in message news:<xEV$7$j0EHA.3152@.cpmsftngxa10.phx.gbl>...
> Named pipes does not use DNS so a DNS alias will not work with named pipes.
> Named pipes uses a broadcast of the NetBios name. Since TCP/IP uses DNS the
> connection works.
> Rand
> This posting is provided "as is" with no warranties and confers no rights.
Rand
I now have this working after using the DisableStrictNameChecking fix.
I can now use the DNA Alias for the SQL server ver named pipes.

Connecting to SQL2000 using DNS Alias/Named Pipes

Hi,
I have a very confusing issue.
I am attempting to connect to a SQL2000 server using Named Pipes and a
DNS Alias without success. I get the sql server does not exist or
access is denied error. I can successfully connect using TCPIP
sockets however.
If I connect to the server using it's own servername I can connect
using Named Pipes or TCPIP sockets.
Any ideas'Named pipes does not use DNS so a DNS alias will not work with named pipes.
Named pipes uses a broadcast of the NetBios name. Since TCP/IP uses DNS the
connection works.
Rand
This posting is provided "as is" with no warranties and confers no rights.|||rboyd@.onlinemicrosoft.com (Rand Boyd [MSFT]) wrote in message news:<xEV$7$j0EHA.3152@.cpmsftngxa10.phx.gbl>...
> Named pipes does not use DNS so a DNS alias will not work with named pipes.
> Named pipes uses a broadcast of the NetBios name. Since TCP/IP uses DNS the
> connection works.
> Rand
> This posting is provided "as is" with no warranties and confers no rights.
Rand
I now have this working after using the DisableStrictNameChecking fix.
I can now use the DNA Alias for the SQL server ver named pipes.

Connecting to SQL2000 using DNS Alias/Named Pipes

Hi,
I have a very confusing issue.
I am attempting to connect to a SQL2000 server using Named Pipes and a
DNS Alias without success. I get the sql server does not exist or
access is denied error. I can successfully connect using TCPIP
sockets however.
If I connect to the server using it's own servername I can connect
using Named Pipes or TCPIP sockets.
Any ideas'Named pipes does not use DNS so a DNS alias will not work with named pipes.
Named pipes uses a broadcast of the NetBios name. Since TCP/IP uses DNS the
connection works.
Rand
This posting is provided "as is" with no warranties and confers no rights.|||rboyd@.onlinemicrosoft.com (Rand Boyd [MSFT]) wrote in message news:<xEV$7$j0EHA.3152@.cpm
sftngxa10.phx.gbl>...
> Named pipes does not use DNS so a DNS alias will not work with named pipes
.
> Named pipes uses a broadcast of the NetBios name. Since TCP/IP uses DNS th
e
> connection works.
> Rand
> This posting is provided "as is" with no warranties and confers no rights.
Rand
I now have this working after using the DisableStrictNameChecking fix.
I can now use the DNA Alias for the SQL server ver named pipes.