Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 Display Modes
  #1 (permalink)  
Old January 8th, 2008, 11:00 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Login failed for user 'username'.

Ok, I have done this a million times before, but this time I am running into a SQL authentication problem that I can not diagnose.

I am running SQL 2005, Server 2003 and ASP.NET 2.0 (3.5 is installed as well)

I have both SQL Server and Windows authentication enabled in SQL server mgmt studio. And I have created a login 'username' under the security->logins tab as well - that user has sysadmin server roles. Yet, when I use my application (that works on another server by the way) I get this error:

Login failed for user 'stan'.

 This is my connection string:

<add name="conString" connectionString="Data Source=localhost;Initial Catalog=tablename;User Id=username;Password=password;" providerName="System.Data.SqlClient"/>

Any ideas? Thank you

Reply With Quote
  #2 (permalink)  
Old January 9th, 2008, 09:13 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

It sounds like ASP.NET is trying to connect with your windows credentials instead of a SQL login. Can you change SQL to use only SQL Server logins to verify this what's happening?

-Peter
Reply With Quote
  #3 (permalink)  
Old January 10th, 2008, 01:22 AM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply, I went in there to triple check that I had this already set and I noticed something strange.

Instead of simply showing

SERVERNAME (SQL Server 9.0.1406...)

like I am used to, it showed

SERVERNAME\OFFICESERVERS (SQL Server 9.0.1406...)

When I had logged on, I had been logging on to the default in the dropdown which was that OFFICESERVERS. I had to choose 'Connect' and show the normal server as well.

I had never had to look for this before, as by default, there will be no OFFICESERVERS. BUT, in this case, on this server, I had already instsalled an instance of Sharepoint... which does. So, I had to recreate all my DBs in the correct Server instance.

Thanks for the help :P I just wasted 3 hours on this...


Reply With Quote
  #4 (permalink)  
Old January 10th, 2008, 07:08 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,190
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

You never wasted hours.. you learned new ways to do it ;)

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #5 (permalink)  
Old January 10th, 2008, 07:23 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

As Edison said: "I have not failed 10,000 times. I have successfully found 10,000 ways that will not work." =]

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote
Reply


Thread Tools
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
Login failed for user. Protoman Classic ASP Databases 3 January 13th, 2008 12:23 PM
Getting 'Login failed for user ' Squeakrz44 VB.NET 2002/2003 Basics 0 November 18th, 2006 05:09 PM
login failed for user domain\user babakwx SQL Server 2000 2 May 30th, 2006 12:28 PM
login failed for user nt authority\anonymous login rj1406 Classic ASP Databases 1 October 24th, 2004 09:15 AM



All times are GMT -4. The time now is 05:08 PM.


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