Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| 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 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 January 9th, 2008, 12:00 AM
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

 
Old January 9th, 2008, 10: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,407
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
 
Old January 10th, 2008, 02: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...


 
Old January 10th, 2008, 08: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,189
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
================================================== =========
 
Old January 10th, 2008, 08: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
================================================== =========




Similar Threads
Thread Thread Starter Forum Replies Last Post
Login failed for user. Protoman Classic ASP Databases 3 January 13th, 2008 01:23 PM
Getting 'Login failed for user ' Squeakrz44 VB.NET 2002/2003 Basics 0 November 18th, 2006 06: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





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