Ahmet Altun
Ahmet Altun

Reputation: 4039

Sql Connection fails when using Integrated Security on IIS applications

In my web application on IIS 7.0, I want to make a connection to Sql Database Server for which my user is granted for Windows Authentication. (Integrated Security=SSPI)

Login fails for user 'DOMAIN\COMPUTER_NAME$', however I still can connect to database over connect window of Sql Server Management Studio (with DOMAIN\USER_NAME).

How can I connect to Sql Server over my web application?

Upvotes: 3

Views: 15554

Answers (2)

Jacob Pressures
Jacob Pressures

Reputation: 1461

My problem was that I had to assign the application pool accounts in SQL Server the db_owner role. I felt that was too much permission but it is the only thing that worked. my book said to give it db_datareader and db_datawriter roles but that did not work.

I'm using SQL Server with Windows Authentication, Windows 7 Home Premium with IIS all on the same machine.

Perhaps someone else will search this issue and find my answer useful.

Upvotes: 0

Ahmet Altun
Ahmet Altun

Reputation: 4039

I've found the solution.

On IIS, open Application Pool settings.

For Identity option, choose "Custom Account".

Enter your username (DOMAIN\USERNAME) and password.

It's done.

Upvotes: 17

Related Questions