Click here to Skip to main content
14,697,190 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I create a very simple website.
when I run website from VS2012 ,website easily can get data from SQLSERVER which run on server which is seperate (I mean SQLSERVER is on one server and I host website on my pc as server).
but when I publish website on my PC IIS,browsing the website from IIS manager cause below error:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON
Posted
Updated 18-Mar-14 0:03am
v2

You probably just need to provide a user name and password in your connectionstring and set Integrated Security=false
   
In IIS7 on your Windows 2008 Web Server...

Please go to Application Pools.

Select your web site.

Click "Advanced Settings" in the "Actions" panel.

Under "Process Model" select "Identity."

In the popup, select the "Custom account" radio button.

"Set" the account and password to your dbo account name and password that are used on your SQL Server 2008 database.

Save that.

Under sites, go to your website. In the Features View panel, select "Authentication" under IIS. Under ASP.Net Impersonation, make sure it's Disabled.

-KR
   
Hi if u use sql server for website,need to SQL Server Authentication,dont use Windows Authentication.Try to give username ,password and providerName="System.Data.SqlClient".

Try to correct datasource in connectionString in web.config file
   
v2
In order to authenticate users with anonymous login you have to do the following things in IIS:
Anonymous Authentication = Enabled
ASP.Net impersonation = Disabled
Windows Authentication = Disabled

In this case anyone can authenticate to your website.


I've stroked out this solution because it is for windows authentication:
In IIS you have to change in authentication pane the Anonymous Authentication value to Disable. After you have to change the impersonation to true.
   
v4
Comments
saeed nazary 18-Mar-14 8:09am
   
Thanks for your answer.
I did what you mentioned.that problem solved but I encounter with a request that wants me to enter Username and Password.
by my credentials which is admin on network I can login without any problem but ordinary users cant login.
but the important problem is this:
I dont want to encounter any credential request for accessing website
could you help me in this regard
norbitrial 18-Mar-14 10:37am
   
I've improved my answer, now you can see the solution for your problem.
Bunch of thanks for your support.
The problem was for sqlserver windows authentication.

Solution is:

1-Create a user in sqlserver from Security section as SqlAuthentication
2-IN VS 2012 ,Create your connection String with SqlAuthentication
(determin Username and Password)
3-there is no need to change any IIS configuration.

thanx and best regards for who answer me,and helped me to solve this issue
   
Comments
saeed nazary 18-Mar-14 11:50am
   
Bunch of thanks for your support.
The problem was for sqlserver windows authentication.

Solution is:

1-Create a user in sqlserver from Security section as SqlAuthentication
2-IN VS 2012 ,Create your connection String with SqlAuthentication
(determin Username and Password)
3-there is no need to change any IIS configuration.

thanx and best regards for who answer me,and helped me to solve this issue

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900