[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Login failed for user 'Servername\ASPNET'.

Posted on 2006-05-12
4
Medium Priority
?
428 Views
Last Modified: 2008-01-09
I am trying to connect to my SQL 2005 Server through an aspx page using window authentication. I get the error message.  My connection string is:       
conNorthwind = new SqlConnection( @"Server=localhost;Integrated Security=SSPI;Database=Northwind" );
My server is named SaintAndrews.  I get the following error  Login failed for user 'SaintAndrews\ASPNET'.

Can anyone help me out with this?
Thanks
0
Comment
Question by:daforga
4 Comments
 
LVL 11

Expert Comment

by:TornadoV
ID: 16668268
It sounds like you are using a trusted security context in your Sql connection string. Try removing the trusted connection goop from the string and adding a valid Sql Server username and Password. Alternately you can give the ASPNET account access to the database in Sql Enterprise
Manager.
0
 
LVL 16

Accepted Solution

by:
MikeMCSD earned 2000 total points
ID: 16668561

conNorthwind = new SqlConnection
(@"Server=localhost;Integrated Security=SSPI;id=sa;password=;Database=Northwind" );
0
 
LVL 6

Expert Comment

by:nehaya
ID: 16669207
Go to your Sql Server,  create new user account with the name : ASPNET and give it permission on your desired tables.

Have fun!
Regards,
Nehaya
0
 

Author Comment

by:daforga
ID: 16671615
actually it is in SQL 2005, so I need3ed to say "user id"  but,  Thanks Mike MCSD.  It worked.   Yay!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month19 days, 22 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question