Solved

Windows authentication on SQL Server 2008 from ASP.NET 4 app

Posted on 2010-08-23
2
431 Views
Last Modified: 2012-06-27
Hi,
I am starting with framework 4 and VS2010 (MS Windows Server 2008 R2 + IIS 7.5). On same server I have SQL Server 2008 which have to access with Windows authentication.

This is my connection string:
<add name="Server" connectionString="Data Source=Server;Initial Catalog=database;Integrated Security=SSPI"   providerName="System.Data.SqlClient" />

I enable only Windows security in IIS Manager-Authentication.

When I try to load aspx page with gridview (only select command) I got this error:
Login failed for user 'IIS APPPOOL\ServiceApp'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'IIS APPPOOL\ServiceApp'.

I have no problem connecting to this server from SQL Server Management Studio with Win Auth.

What else do I have to do to connect to sql server from my app?

Thanks guys.
0
Comment
Question by:kahvedzic
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
>Login failed for user 'IIS APPPOOL\ServiceApp'
this means that that login is NOT (yet) defined in the SQL Server logins ...

see also:
http://msdn.microsoft.com/en-us/library/ff647396.aspx
0
 
LVL 1

Author Closing Comment

by:kahvedzic
Comment Utility
Simple and fast, but I need help anyway. Thanks once more
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now