 |
| 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
|
|
|
|

June 10th, 2003, 12:47 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 10th, 2003, 12:50 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 10th, 2003, 01:28 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 10th, 2003, 01:29 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Oops. I was thinking of plain vanilla ASP.
Thanks for pointing that out.
regards
David Cameron
|
|

June 11th, 2003, 02:51 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
how do i add the ASPNet user account to the permitted SQL server logins?
|
|

June 11th, 2003, 03:56 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 11th, 2003, 10:04 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 11th, 2003, 10:36 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 12th, 2003, 01:54 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i did exactly wht John told me to do.. and that is the product.. erm the codes i pasted later.
|
|

June 12th, 2003, 09:03 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |