473,396 Members | 1,804 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.

Error : Login failed for user 'MACHINE\ASPNET' :/

Hello all,

I'm working with Windows XP PRO SP1, ASP.NET v2 (with
Visual Web Dev) and, MS SQL 2005 with a database with
Windows Authentication mode. I've an aspx page which must
send a query to the database. But i have this exception :

Login failed for user 'KLEO\ASPNET'.
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 'KLEO\ASPNET'.

I have put TOTAL CONTROL to the ASPNET User for the
"wwwroot" folder.

What must i do to resolve this problem? Please say me step
by step since i am a novice in MSSQL & ASP.NET.

Thank your for helping!
Nov 18 '05 #1
3 4893
It has nothing to do with the directory permissions within the app. The
problem is, you're using a trusted connection to talk to the SQL server.
That meas that the ASPNet user account is the one logging into the SQL
Server. You either have to use a sql server login and not a trusted login,
or you have to set the ASPNet user to have permissions to log into the SQL
Server by adding the ASPNet account to the list of available SQL Server
users.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Mr.KisS" <an*******@discussions.microsoft.com> wrote in message
news:26*****************************@phx.gbl...
Hello all,

I'm working with Windows XP PRO SP1, ASP.NET v2 (with
Visual Web Dev) and, MS SQL 2005 with a database with
Windows Authentication mode. I've an aspx page which must
send a query to the database. But i have this exception :

Login failed for user 'KLEO\ASPNET'.
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 'KLEO\ASPNET'.

I have put TOTAL CONTROL to the ASPNET User for the
"wwwroot" folder.

What must i do to resolve this problem? Please say me step
by step since i am a novice in MSSQL & ASP.NET.

Thank your for helping!

Nov 18 '05 #2
On Mon, 5 Jul 2004 14:46:58 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
Hello all,

I'm working with Windows XP PRO SP1, ASP.NET v2 (with
Visual Web Dev) and, MS SQL 2005 with a database with
Windows Authentication mode. I've an aspx page which must
send a query to the database. But i have this exception :

Login failed for user 'KLEO\ASPNET'.
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 'KLEO\ASPNET'.

I have put TOTAL CONTROL to the ASPNET User for the
"wwwroot" folder.

What must i do to resolve this problem? Please say me step
by step since i am a novice in MSSQL & ASP.NET.


Giving control to a folder (directory) will have little effect on a
SQL Server login issue. ASPNET is using the account KLEO/ASPNET (I
would assume your PC's name is KLEO. I would also assume that this
account does not have rights to the SQL Server. Remember that the
aspnet_wp.exe program that is actually executing the application.
Several options listed below...

Give KLEO/ASPNET rights on the SQL Server box (not recommended)

Change the account that ASP.NET uses for this virtual directory to one
that has rights to the SQL Server box.

Use impersonation set in the Web.config file for the asp application,
referring to an account that has rights to the SQL Server box.
Nov 18 '05 #3
Ok, but i dont know how to change the rights of KLEO\ASPNET
for the SQL Server. How to do? I'm under MS SQL 2005
Express. There isn't an enterprise manager or visual guide.
Have you a command line or something that i could use?

Regards.
-----Original Message-----
On Mon, 5 Jul 2004 14:46:58 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
Hello all,

I'm working with Windows XP PRO SP1, ASP.NET v2 (with
Visual Web Dev) and, MS SQL 2005 with a database with
Windows Authentication mode. I've an aspx page which must
send a query to the database. But i have this exception :

Login failed for user 'KLEO\ASPNET'.
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 'KLEO\ASPNET'.

I have put TOTAL CONTROL to the ASPNET User for the
"wwwroot" folder.

What must i do to resolve this problem? Please say me step
by step since i am a novice in MSSQL & ASP.NET.

Giving control to a folder (directory) will have little

effect on aSQL Server login issue. ASPNET is using the account KLEO/ASPNET (Iwould assume your PC's name is KLEO. I would also assume that thisaccount does not have rights to the SQL Server. Remember that theaspnet_wp.exe program that is actually executing the application.Several options listed below...

Give KLEO/ASPNET rights on the SQL Server box (not recommended)
Change the account that ASP.NET uses for this virtual directory to onethat has rights to the SQL Server box.

Use impersonation set in the Web.config file for the asp application,referring to an account that has rights to the SQL Server box.
.

Nov 18 '05 #4

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

Similar topics

0
by: Lee Falin | last post by:
>-----Original Message----- >hello, > >i am trying to write aspx login system and the login process requires a >validity check of username and password. > >i have a c# class which calls the...
11
by: suzy | last post by:
i am trying to write aspx login system and the login process requires a validity check of username and password. i have been told that raising exception is costly, but i want a custom error...
1
by: PABLIN | last post by:
Hello I have a problem of connection with SQL SERVER from Visual VB.NET Studio, but in WebMatrix all this good. Error: "Cannot open database requested in login 'tonet'. Login fails. Login...
1
by: dk | last post by:
this is the DSN connection string in web.confi <add key="DSN" value="server=localhost;database=userDB;Integrated Security=SSPI" / any idea regarding what is causing this following error message...
13
by: Edward Mitchell | last post by:
I have a problem that involves the error I receive when attempting to complete the asp.net web application example (Walkthrough: Creating a Web Application Using a Third-Party Business Object). ...
12
by: Michael | last post by:
Please Help me. I've got a .Net 2003 program that attaches to a SQL Server machine and I'm getting the above error when a user tries to log in. The SQL server is setup to use Windows Auth. and I...
0
by: Don | last post by:
When I attempt to access a SQL Server database from my ASP.NET 1.1 application I get the folllowing error: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server...
2
by: Tim Zych | last post by:
When I try to connect to a sql server database using Windows Authentication, I get a message that the login failed: Cannot open database "codelib" requested by the login. The login failed. Login...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.