[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

QuickSamples Intro8.aspx

Chris

12/18/2002 5:08:00 PM

I've installed Visual Studio .NET and the .NET Framework
SDK. Navigating to the Introducing Web Services
QuickStart tutorial, I attempt to access the Intro8.aspx
sample. I get the following after clicking the Lookup
button :

Server Error in '/QuickStart/ASPPlus' Application.
----------------------------------------------------------
----------------------

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

Source Error:


Line 19:
Line 20: DS = new DataSet()
Line 21: MyCommand.Fill(DS, "Titles")
Line 22:
Line 23: MyList.DataSource = DS.Tables
("Titles").DefaultView

(Note: XXXXXX - machine name has been removed from code)



Does anyone have an idea on how to resolve this?
1 Answer

(Felix Wu [MS])

12/19/2002 4:47:00 AM

0

Hi Chris,

This is because the ASP.NET worker process account 'ALD02855\ASPNET' has no
access to the SQL database. By default, the ASP.NET worker process
(aspnet_wp.exe) is running with the local account "ASPNET", which is a low
privileged account and has not access to SQL database by default.

To make your application work, you can use one of the following methods:

- Enable Impersonation in your web application, so that the SQL requests
run under the context of web application users or a given user you specify
in the web.cofing. For example, add the following section in the web.config
file:

<system.web>
..
<identity impersonate="true" userName="xxxx" password="xxxx"/>
..
</system.web>

However, you should make sure these users have proper access permissions in
the SQL server.

- Change the default configuration of ASP.NET so that the ASP.NET worker
process starts and runs under the context of a user who has the proper
permissions in SQL Server. To do so, config the <processModel> session in
the machine.config file
(WINDOWS\Microsoft.NET\Framework\v1.0.3705\CONFIG\machine.config)

- Grant the access permissions to the local ASPNET account on SQL Server.

- Programmatically change the security context of the ASP.NET worker
process to a user that has the proper SQL Server permissions.

For more information, please check the following KB articles:

316989.KB.EN-US PRB: "Login Failed" Error Message When You Create a Trusted
Data
http://support.microsoft.com/default.aspx?scid=KB;EN...

306158.KB.EN-US: INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/default.aspx?scid=KB;EN...

Hope this helps.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>Content-Class: urn:content-classes:message
>From: "Chris" <c_lein@hotmail.com>
>Sender: "Chris" <c_lein@hotmail.com>
>Subject: QuickSamples Intro8.aspx
>Date: Wed, 18 Dec 2002 08:08:17 -0800

>Lines: 34
>Message-ID: <077101c2a6af$acea5080$d7f82ecf@TK2MSFTNGXA14>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Thread-Index: AcKmr6zn3Qesd+BPSBa/yUQ82rkpIg==
>Newsgroups: microsoft.public.dotnet.framework.sdk
>NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
>Path: cpmsftngxa06!cpmsftngxa10!cpmsftngxa09
>Xref: cpmsftngxa06 microsoft.public.dotnet.framework.sdk:5437
>X-Tomcat-NG: microsoft.public.dotnet.framework.sdk
>
>I've installed Visual Studio .NET and the .NET Framework
>SDK. Navigating to the Introducing Web Services
>QuickStart tutorial, I attempt to access the Intro8.aspx
>sample. I get the following after clicking the Lookup
>button :
>
>Server Error in '/QuickStart/ASPPlus' Application.
>----------------------------------------------------------
>----------------------
>
>Login failed for user 'XXXXXXXX\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 'ALD02855\ASPNET'.
>
>Source Error:
>
>
>Line 19:
>Line 20: DS = new DataSet()
>Line 21: MyCommand.Fill(DS, "Titles")
>Line 22:
>Line 23: MyList.DataSource = DS.Tables
>("Titles").DefaultView
>
>(Note: XXXXXX - machine name has been removed from code)
>
>
>
>Does anyone have an idea on how to resolve this?
>