I created a Web Application that runs on the Visual Studio Development Server. It connects to the SQL Server using Windows Authentication. Then I run it on the IIS(in localhost) and tried using the same connection Strings to connect to database. It gives
an error,
System.Data.SqlClient.SqlException: Cannot open database "DATABSENAME" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\DefaultAppPool'.
How shall I change this?
Malin De Silva
www.malindesilva.com
Microsoft Student Ambassador, Sri Lanka
Editor, INTECS
Information Technology Society
University of Moratuwa, Sri Lanka
Rockmarley
Member
66 Points
62 Posts
IIS SQL Server connect using Windows Authentication
Feb 21, 2012 04:56 AM|LINK
Hi,
I created a Web Application that runs on the Visual Studio Development Server. It connects to the SQL Server using Windows Authentication. Then I run it on the IIS(in localhost) and tried using the same connection Strings to connect to database. It gives an error,
System.Data.SqlClient.SqlException: Cannot open database "DATABSENAME" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
How shall I change this?
www.malindesilva.com
Microsoft Student Ambassador, Sri Lanka
Editor, INTECS
Information Technology Society
University of Moratuwa, Sri Lanka
Careed
All-Star
18798 Points
3649 Posts
Re: IIS SQL Server connect using Windows Authentication
Feb 21, 2012 04:59 AM|LINK
You need to use ASP.NET Impersonation. You can configure this within the IIS Manager using the Authentication icon.
"The oxen are slow, but the earth is patient."
Rockmarley
Member
66 Points
62 Posts
Re: IIS SQL Server connect using Windows Authentication
Feb 21, 2012 05:05 AM|LINK
It still does not work
www.malindesilva.com
Microsoft Student Ambassador, Sri Lanka
Editor, INTECS
Information Technology Society
University of Moratuwa, Sri Lanka
Careed
All-Star
18798 Points
3649 Posts
Re: IIS SQL Server connect using Windows Authentication
Feb 21, 2012 05:34 AM|LINK
Instead of using Windows Authentication in SQL Server, using Integrated Security instead.
"The oxen are slow, but the earth is patient."