tags:

views:

121

answers:

3

Hi Guys,

i tried to open the website from broswer project is deployed at IIS i am getting this exception Exception information: Exception type: SqlException Exception message: Cannot open database "TestDB" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

any solution?

Regards kumar

A: 

Check the Connection String.

Paulo Santos
connection string is fine
kumar
+1  A: 

Your IIS application runs under the NT AUTHORITY\NETWORK SERVICE account

You can use Windows Authentication and Impersonation http://msdn.microsoft.com/en-us/library/aa292118%28VS.71%29.aspx

Use Windows Authentication and a fixed account (either by adding the NT AUTHORITY\NETWORK SERVICE account to SQL Server or by creating a new account for that purpose and configuring the application pool in IIS to use that account)

Or you can use SQL authentication with user name and password in the (possibly encrypted) connection string in the web.config

Martin Smith