?
Solved

IIS7 Application Pool Cannot Connect to SQL Server 2008 Database

Posted on 2011-09-15
4
Medium Priority
?
769 Views
Last Modified: 2012-05-12
Hello all,
 I have a server running Windows Server 2008, IIS7, and SQL Server 2008, on which I am running an ASP.NET application. For some reason, I am getting an error at the logon screen of the Web app stating the following:

Can't connect to DB:

[Microsoft][SQL Server Native Client 10.0] Named Pipes Provider: Could not open a connection to SQL Server [2].


GET variables:
--------------

POST variables
--------------:

SESSION variables:
------------------
DBType = SQLSERVER
NetClassification = ""
BlahBlahBlah = Application Name
LocalShift = -120

Basically what I have narrowed it down to is that the credentials the IIS app pool is using to try to connect to the database with are wrong. The thing is I cannot figure out where to go to configure the credentials that are being used to connect to the DB.

Does this make sense? Does anyone have any advice?
0
Comment
Question by:BoxunloX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Expert Comment

by:gaurav05
ID: 36542006
Hi,

you need to configure connection string in web.config file.

<connectionStrings>
<add name="myConnectionString" connectionString="server=localhost;database=myDb;uid=myUser;password=myPass;" />
</connectionStrings>

also you need to provide sa username & Password. in this connection string.
0
 
LVL 1

Accepted Solution

by:
BoxunloX earned 0 total points
ID: 36542111
The connection string is already there. I actually just figured out the issue. I had to configure the app pool to authenticate with a local admin account in IIS7 and I also did this in SQL Server 2008 in the security properties of the database that I was trying to connect to. Once I did this everything worked fine.
0
 
LVL 1

Author Closing Comment

by:BoxunloX
ID: 36565403
figured out the solution myself.
0
 
LVL 1

Expert Comment

by:NajamG
ID: 36542704
Hi,
 Create a blank text file and save it with .udl extension i.e abc.udl
A warning that changing file extensions can cause files to become unusable might appear. Disregard it.
Double-click the universal data link (.udl) file.
The Data Link Properties dialog box opens, displaying the following tabs: Provider, Connection, Advanced, and All. Choose Next to navigate from tab to tab.
On the Provider tab, select a database provider.
On the Connection tab, either select the data source name (DSN) of an available Provider, or enter a custom connection string. Valid DSNs for providers that are pre-defined on your system are displayed in the Use Data Source drop-down list.
Use the Advanced tab to view and set other initialization properties for your data.
Use the All tab to review and edit all OLE DB initialization properties available for your OLE DB provider.
Choose OK to save the connection string to the Universal Data Link (.udl) file.

Now Open this udl file with notepad and in last line you will get actual Connection String. You can use this connection string in any application.




 
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question