Not connceting to remote sqlserver through IIS

R

Reddy

When I create an websit in VS2005 and run it then it is running on the port
and it is connecting to remote sqlserver. But when I create Virtual directory
in IIS and try to run my website it is not connecting to remote sqlserver. i
am getting the following error.

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)

Can any one help me in this?
 
S

Sanket Sirotiya

Hi Reddy,

Are you connecting to IIS hosting ASP.NET 2005 and SQL Server 2000 ????
 
N

Norman Yuan

You need to make two things sure:

1. The SQL Server on other computer is accessible (it seems so, since you
can connec to it when run the web app from VS);
2. Which user account is running your web application/IIS. As web app
developer, you should know it and configure the web app runs under
appropriate user account according to security/business requirement. Then
you can tell if the user account has permission to access SQL Server in the
other computer or not. I guess this is where your problem is.

When you run your app inside VS, it is very likely (especially when you use
VS built-in web server), the web app is runing with the identity of your
user account, which has access to the SQL Server. When you move your web app
to IIS (in which computer), depending on how you configure the web app's
security (Windows authentication? Anonymous access? Impersonate?...), the
web app may very likely run as a user account (ASPNET or Network Service, by
default) that does not have access to SQL Server or network resources.

So, you need to ask your self: which user account is used? does it have
access to the SQL Server?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top