Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2003, 12:47 AM
Authorized User
 
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL authentication is ASPX application

Hi,

could anyone help me in solving this problem of authentication in SQL server with an aspx application... my user name is sa and i have already set my password, but nothing seems to work.

Server Error in '/WebApplication2' Application.
--------------------------------------------------------------------------------

Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.
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.OleDb.OleDbException: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.

Source Error:


Line 10: Dim objDataSet As DataSet = New DataSet
Line 11: Public Sub New()
Line 12: objConnection.Open()
Line 13: objConnection.Close()
Line 14: objDataAdapter.SelectCommand = New OleDbCommand
 
Old June 10th, 2003, 12:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your connection string is invalid. At a guess SQL Server is running in NT Authentication only mode. Go into EM, right click on the server and change to NT and SQL authenication. ALternatively add the login IUSR_<your webserver name> to the server.

regards
David Cameron
 
Old June 10th, 2003, 01:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, unless saint is using impersonation, he'd/she'd need to add the ASPNet user account to the permitted SQL Server logins.

Cheers
Ken

www.adOpenStatic.com
 
Old June 10th, 2003, 01:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oops. I was thinking of plain vanilla ASP.

Thanks for pointing that out.

regards
David Cameron
 
Old June 11th, 2003, 02:51 AM
Authorized User
 
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

how do i add the ASPNet user account to the permitted SQL server logins?
 
Old June 11th, 2003, 03:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

In order to create ASPNET account on SQL Server you have to:
1. Run Enterprise Manager
2. Expand the security folder
3. Right click on Logins and choose New Login from he context menu
4. In the name box you have to type ASPNET
5. In the domain box you have to type yur SQL Server name
6. For the auth mode you have to select Windows Authentication
7. On the database tab youhave to slect all databases you need for ASP.NET pages



...but the Soon is eclipsed by the Moon
 
Old June 11th, 2003, 10:04 PM
Authorized User
 
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Login failed for user 'NGEEANNPOLYTECH\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.OleDb.OleDbException: Login failed for user 'NGEEANNPOLYTECH\ASPNET'.

Source Error:


Line 10: Dim objDataSet As DataSet = New DataSet
Line 11: Public Sub New()
Line 12: objConnection.Open()
Line 13: objConnection.Close()
Line 14: objDataAdapter.SelectCommand = New OleDbCommand
 
Old June 11th, 2003, 10:36 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to permit the user: NGEEANNPOLYTECH\ASPNET to login to your database. if you have Enterprise Manager, then do the steps outlined by NotNowJohn. If you only have osql.exe (part of MSDE) you can download the trial version of SQL Server from Microsoft's site, and just install the client tools (they do not expire) -or- you can use osql.exe and follow the instructions here: http://www.asp.net/Forums/ShowPost.a...1&PostID=87085

www.adOpenStatic.com
 
Old June 12th, 2003, 01:54 AM
Authorized User
 
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i did exactly wht John told me to do.. and that is the product.. erm the codes i pasted later.
 
Old June 12th, 2003, 09:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, let's try this one step at a time:
Please go into Enterprise Manager, expand your local server, goto the Security node, and give us a list of permitted logins

Cheers
Ken

www.adOpenStatic.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
How I Can Setup A Counter Using ASPX Application O yoord ADO.NET 1 May 29th, 2004 04:35 AM
aspx application??? blackcafe BOOK: Beginning ASP.NET 1.0 1 May 18th, 2004 07:12 AM
ASPX role authentication digriz60 ASP.NET 1.0 and 1.1 Basics 3 November 5th, 2003 11:48 AM
Authentication in ASPX(VB .NET) CFerthorney ASP.NET 1.0 and 1.1 Professional 5 September 9th, 2003 10:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.