Solved

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

Posted on 2010-08-23
2
442 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
[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 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 33498631
>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
ID: 33499354
Simple and fast, but I need help anyway. Thanks once more
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

734 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