Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2003, 12:47 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old June 10th, 2003, 12:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #3 (permalink)  
Old June 10th, 2003, 01:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #4 (permalink)  
Old June 10th, 2003, 01:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #5 (permalink)  
Old June 11th, 2003, 02:51 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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?
Reply With Quote
  #6 (permalink)  
Old June 11th, 2003, 03:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
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
Reply With Quote
  #7 (permalink)  
Old June 11th, 2003, 10:04 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #8 (permalink)  
Old June 11th, 2003, 10:36 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #9 (permalink)  
Old June 12th, 2003, 01:54 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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.
Reply With Quote
  #10 (permalink)  
Old June 12th, 2003, 09:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.