473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SQL Connection problem

Hi all,
I tried to connect a database(SQL) by both VS 2003 interface tools and
normal typing.

When I make the connection in subdirectory project it doesn't work and gives
an
error like this;

Server Error in '/WebApplication1' Application.
----------------------------------------------------
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Nevertheless, when I use the same .aspx page in normal web site (without any
sub directory) it works without any error.

I have been using Windows 2000 and it was both working but when I installed
Windows 2003 Enterprise Edition, it started to give that error(below). So,
most probably this error acquires because of Windows 2003 settings is there
anyone who knows how to solve this problem?

Kind Regards,
Arda Coskun


Nov 17 '05 #1
1 3661
Arda,
By default, the ASP.NET worker process on a Windows Server 2003 (IIS6)
machine uses the local "NT AUTHORITY\NETWORK SERVICE" user
account. And on Windows 2000 / XP (IIS 5.x), it uses the local ASPNET .
user account. Also, ASP.NET has impersonnation turned off by default.

Hence, in this configuration, if you want your web page to access a Sql Server
database, you'll need to give database access permissions to the corresponding
local user account, depending on which IIS version you are using.

Here is a summary for a machine called "CARLP7" on IIS 5.x,
with Authentication mode="Windows" in web.config

- If Identity impersonate="false" and IIS Anon Access enabled
=> WindowsIdentity.GetCurrent().Name = CARLP7\ASPNET

- If Identity impersonate="false" and IIS NTLM enabled
=> WindowsIdentity.GetCurrent().Name = CARLP7\ASPNET

- If Identity impersonate="true" and IIS Anon Access enabled
=> WindowsIdentity.GetCurrent().Name = CARLP7\IUSR_CARLP7

- If Identity impersonate="true" and IIS NTLM enabled
=> WindowsIdentity.GetCurrent().Name = CARLP7\Administrator (logged on user)
Here is a summary for a machine called "CARLP7" on IIS 6.0,
with Authentication mode="Windows" in web.config

- If Identity impersonate="false" and IIS Anon Access enabled
=> WindowsIdentity.GetCurrent().Name = NT AUTHORITY\NETWORK SERVICE

- If Identity impersonate="false" and IIS NTLM enabled
=> WindowsIdentity.GetCurrent().Name = NT AUTHORITY\NETWORK SERVICE

- If Identity impersonate="true" and IIS Anon Access enabled
=> WindowsIdentity.GetCurrent().Name = CARLP7\IUSR_CARLP7

- If Identity impersonate="true" and IIS NTLM enabled
=> WindowsIdentity.GetCurrent().Name = CARLP7\Administrator (logged on user)

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com
"Arda" <sa*@simetriyazilim.com> wrote in message news:#f**************@TK2MSFTNGP10.phx.gbl...
Hi all,
I tried to connect a database(SQL) by both VS 2003 interface tools and
normal typing.

When I make the connection in subdirectory project it doesn't work and gives
an
error like this;

Server Error in '/WebApplication1' Application.
----------------------------------------------------
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Nevertheless, when I use the same .aspx page in normal web site (without any
sub directory) it works without any error.

I have been using Windows 2000 and it was both working but when I installed
Windows 2003 Enterprise Edition, it started to give that error(below). So,
most probably this error acquires because of Windows 2003 settings is there
anyone who knows how to solve this problem?

Kind Regards,
Arda Coskun

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Harry | last post by:
Using Oracle 8i enterprise on win 2000 (sp3) Installed the standard configuration & whenever I make a connection it takes about 10 secs. It's running on a P1900 with 1gb Ram so no reason there...
11
by: sonajain | last post by:
Hi, The database transaction log file is full. I cannot delete the log file. when I try to take backup it throws error. Any other way so that I can write more transaction without any problem....
0
by: iKiLL | last post by:
Hi All Code Below for this problem ERROR: "An existing connection was forcibly closed by the remote host"
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.