Login failed for user 'myComputer\ASPNET'

T

trouling

An aspx page I made with a DataGrid and SQLConnection to my local MS
SQL server shows appropriate DB information when view from within the
..NET designer. However, when selecting: "View in Browser", the
following error appears.

Login failed for user 'myComputer\ASPNET'

Selected failing code is:
SqlDataAdapter1.Fill(AuthorsDS1)

Any ideas where I can set the appropriate authentication properties. Is
it in the setup of MS SQL or IIS?
 
J

Juan T. Llibre

re:
Login failed for user 'myComputer\ASPNET'

Is "myComputer\ASPNET" a login name in your SQL Server ?

It seems you are using Windows authentication in SQL Server.

If so, you need to add "myComputer\ASPNET" to the logins for your database.
 
A

Adam Knight

You really haven't provided any useful information so someone can
intelligently help!
IE: connection string.

From your error, i am assuming your db connection string specifies that your
using window integrated security.

Check that you have added the asp.net account to your sql server logins...

Cheers,
Adam
 
B

Brock Allen

The windows identity your app is running under doesn't have credentials to
authenticate in your database. You need to change the identity of the application
(via <processModel> in machine.config) to a user that can authenticate against
your database (perhaps a domain user).
 
P

Paul Clement

On 6 Oct 2005 15:14:02 -0700, (e-mail address removed) wrote:

¤ An aspx page I made with a DataGrid and SQLConnection to my local MS
¤ SQL server shows appropriate DB information when view from within the
¤ .NET designer. However, when selecting: "View in Browser", the
¤ following error appears.
¤
¤ Login failed for user 'myComputer\ASPNET'
¤
¤ Selected failing code is:
¤ SqlDataAdapter1.Fill(AuthorsDS1)
¤
¤ Any ideas where I can set the appropriate authentication properties. Is
¤ it in the setup of MS SQL or IIS?

The answer to this question largely depends upon your configuration. If your ASP.NET app is
configured for Integrated Windows authentication with a local SQL Server database then enabling
impersonation should resolve the problem.

http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Joined
May 9, 2008
Messages
1
Reaction score
0
login failed for user ASPNET permissions problem

Trying to get this information into every thread with this problem:

The issue can be caused by order of installation.
when you run aspnet_regiis, it creates the ASPNET user, and adds it to all the appropriate systems/functions. If you install MSSQL after the fact, that user does not exist or have proper permissions to the databases

there are a series of SQL commands you can use to add the user, it is simple in SQL Manager, but for most of us, the simple solution is to re-run aspnet_regiis.exe. use -? to get the manual if you need to make sure that you don't interfere with any .net websites you are using. The simple -i option worked for me. Sometimes (not always from other posts I've read) the more direct aspnet_regsql.exe will add the aspnet user permissions to the database.

One symptom of this is when you are using Visual studio (VS), it will not run in development mode, but when you run in debugging mode it runs fine. I think activating the debug mode runs in a special debug environment that eliminates the aspnet user requirement on the database access. (according to my Event Viewer)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top