SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 4th, 2003, 10:33 PM
Sloper Sloper is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Phoenix, AZ
Posts: 2 Sloper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy System.Data.SqlClient.SqlException: Login failed

How many times have we seen this error exception?

System.Data.SqlClient.SqlException: Login failed for user '<MY COMPUTER>\ASPNET'. at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at <MY WEB PAGE>.Page_Load(Object sender, EventArgs e) in <MY SOURCE>.ascx.cs:line 26

SqlConnection conn = new SqlConnection("user id=<login>;pwd=<password>;server=<MY COMPUTER>\\vsdotnet;integrated security=SSPI;initial catalog=<DB>;");
line 26: conn.Open();


I've tried various connection strings.
o user id=sa;pwd=;
o Trusted_Connection=yes;
I have configured SQL server to accept both Windows and SQL logins. I have even succesfully connected via SQL Query Analyzer with the same login I used in my connection string. So I know the SQL server appears to be configured correctly.

I also created a ODBC System DNS to my SQL server if that can be used somehow. I was able to get my PHPbb forum to connect via ODBC succesfully this way.

What is the initial catalog anyhow? I gave it the name of the Database I wish to access a table within.

All I want to do is display a table from my SQL database and allow the web user to sort the various columns in the table.
Any good example pointers you might have to perform this task?

I am pretty new to all this so think easy newbie stuff.... Thanks for any help.

Reply With Quote
  #2  
Old December 8th, 2003, 03:59 PM
Sloper Sloper is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Phoenix, AZ
Posts: 2 Sloper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Bah, I got it....

In my searching I learned a bit more too. I found it better to put the connection string in the Web.config file. A buddy of mine was confused why I had two slashes in the server name. Because he uses VB where I use C# so I put the connection string in the Web.config and only need one slash then. Also, it is a bit more secure then.

<configuration>

<!-- application specific settings -->
<appSettings>
<add key="connString" value="user id=sa;pwd=;server=<serverName>\VSdotNET;integrated security=SSPI;trusted_connection=true;initial catalog=<Database>;" />
</appSettings>
....


In C# access looks like this....

SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["connString"]);
try {
conn.Open();
...


But, that still doesn't solve any login failures I had....
Even though I added my specified login because I wasn't using sa; actually I still am not using sa I setup another login. I thought I could just have it but you need to allow ASPNET to login too. Anyhow, here's how....

Microsoft sql server -> enterprise manager.

Microsoft SQL Server
SQL Server Group
serverName\VSDOTNET (Windows NT)
Security
Logins <right click>

New Login
Name <click ....>
scrolll down to the ASPNET (aspnet wp account)
You can set default database if you wish here too.

After that I went to the specific database I was interested in
and set permissions to allow the various database commands.
and finally I was good to go.....

Hope that helps anyone with similar issues. I know I struggled to find good explanations since there are so many different reasons for this same error. I heard there was a FAQ out there for this common error but I never did find it. If someone knows where be nice to add the link to the FAQ in a reply.

Last edited by Sloper : December 8th, 2003 at 04:05 PM.

Reply With Quote
  #3  
Old March 23rd, 2004, 09:35 PM
marioalv marioalv is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 marioalv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up Thanks...

Many Many thanks!!! That solution:

Code:
Microsoft sql server -> enterprise manager. 

Microsoft SQL Server 
SQL Server Group 
serverName\VSDOTNET (Windows NT)
Security
Logins <right click>

New Login
Name <click ....>
scrolll down to the ASPNET (aspnet wp account)
You can set default database if you wish here too.


was just what I was looking for... URL

Reply With Quote
  #4  
Old June 23rd, 2004, 05:42 PM
carterdn carterdn is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Texas
Posts: 1 carterdn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face RE: Bah I got it

I'm quickly finding that in order to develop DB accessed Web Apps in VSDOTNET that you
need to know a lot more about SQL Server than just how to install it on a machine, build tables,
stored procedures, SELECT queries, etc. This place seems to have gotten me through two
hang ups already today. Thanks SLOPER!

Microsoft SQL Server
SQL Server Group
serverName\VSDOTNET (Windows NT)
Security
Logins <right click>

New Login
Name <click ....>
scrolll down to the ASPNET (aspnet wp account)

Reply With Quote
  #5  
Old December 12th, 2004, 09:07 PM
tryston02 tryston02 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 20 tryston02 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 24 m 10 sec
Reputation Power: 0
Cant find the ASPNET account

Quote:
Originally Posted by carterdn
I'm quickly finding that in order to develop DB accessed Web Apps in VSDOTNET that you
need to know a lot more about SQL Server than just how to install it on a machine, build tables,
stored procedures, SELECT queries, etc. This place seems to have gotten me through two
hang ups already today. Thanks SLOPER!

Microsoft SQL Server
SQL Server Group
serverName\VSDOTNET (Windows NT)
Security
Logins <right click>

New Login
Name <click ....>
scrolll down to the ASPNET (aspnet wp account)

Hey guys, I followed your instructions and cannot find the ASPNET account when I click the new user and scroll through the list. I have .NET installed. Do I have to create the ASPNET account in Active Directory first?

Thanks,

Chris

Reply With Quote
  #6  
Old November 29th, 2005, 09:06 AM
numdog numdog is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 1 numdog User rank is Private First Class (20 - 50 Reputation Level)numdog User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 55 m 31 sec
Reputation Power: 0
Solution to Login Failed !

Quote:
Originally Posted by Sloper
Bah, I got it....


Microsoft sql server -> enterprise manager.

Microsoft SQL Server
SQL Server Group
serverName\VSDOTNET (Windows NT)
Security
Logins <right click>

New Login
Name <click ....>
scrolll down to the ASPNET (aspnet wp account)
You can set default database if you wish here too.

After that I went to the specific database I was interested in
and set permissions to allow the various database commands.
and finally I was good to go.....

Hope that helps anyone with similar issues. I know I struggled to find good explanations since there are so many different reasons for this same error.


You don't know how much this helped me. I was working on my first web form project and was about to give up when I stumbled across your solution. Thank you, thank you ! This gave me the confidence to push through other similar road blocks until I finished the project.

Cheers.
Kathy
Comments on this post
nofriends agrees: excellent!

Reply With Quote
  #7  
Old November 29th, 2005, 04:09 PM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
Click here for more information.
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,198 nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)  Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 8 h 39 m 27 sec
Reputation Power: 719
Hi Kathy,
welcome to the forum
I just want to say, weldone for searching the forum first
before asking questions that have been answered before!

Glad your application is finished and working, you know where to
find us if you need any further help

Cheers
noFriends
__________________
Look! Its a ShemZilla



Reply With Quote
  #8  
Old March 21st, 2006, 07:06 PM
iffi iffi is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 1 iffi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 57 sec
Reputation Power: 0
System.Data.SqlClient.SqlException: Login failed for user 'ServerName\SKNET81$'.

Hello,
I am new to this forum .. I have tried the way you explained but it didn't work for me.
I am using ASP.NET 2.0 membership APIs to build login system with MS SQL 2000. The site is accessable using username and password. The system is working fine on my local machine but when i deployed on the site it has started giving error like
--------------------
System.Data.SqlClient.SqlException: Login failed for user 'ServerName\SKNET81$'.
----------------


I was wondering why this error comes even tough i dont have any database user with name "ServerName\SKNET81$".

I have searched through the net but couldn't find the proper answer that could solve my problem. Please help or refer me to proper place for solution.

With Best Regards
Iffi

Reply With Quote
  #9  
Old March 14th, 2007, 11:34 AM
dashing dashing is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 1 dashing User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 17 sec
Reputation Power: 0
Quote:
Originally Posted by iffi
Hello,
I am new to this forum .. I have tried the way you explained but it didn't work for me.
I am using ASP.NET 2.0 membership APIs to build login system with MS SQL 2000. The site is accessable using username and password. The system is working fine on my local machine but when i deployed on the site it has started giving error like
--------------------
System.Data.SqlClient.SqlException: Login failed for user 'ServerName\SKNET81$'.
----------------


I was wondering why this error comes even tough i dont have any database user with name "ServerName\SKNET81$".

I have searched through the net but couldn't find the proper answer that could solve my problem. Please help or refer me to proper place for solution.

With Best Regards
Iffi



Asalam o Alikum ,
For this problem i sujjest you to , create the acount of the same name and grant access to it, definiting some spacific domain ..... insallah it works

Reply With Quote
  #10  
Old March 15th, 2007, 03:42 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
Click here for more information.
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,198 nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)  Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 8 h 39 m 27 sec
Reputation Power: 719
as you can see, this thread has been solved, and over a year old,
please don't post in threads like this

Reply With Quote
  #11  
Old March 20th, 2007, 07:47 AM
aelhabboub aelhabboub is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 3 aelhabboub User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 10 m 54 sec
Reputation Power: 0
aspnet account on winxp

i can not find the aspnet account
i am using windows xp sp2, with vs 2005, and framework 2.0
what to do?

Reply With Quote
  #12  
Old March 20th, 2007, 08:01 AM
nofriends's Avatar
nofriends nofriends is offline
Senior Water Wizard
Click here for more information.
 
Join Date: Aug 2004
Location: Cape Town, RSA
Posts: 10,198 nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)nofriends User rank is Major General (70000 - 90000 Reputation Level)  Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1Folding Points: 175451 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 Days 8 h 39 m 27 sec
Reputation Power: 719
as you can see to the previous post of mine, please
dont post in old threads, if you have a problem, create
a new thread and post your problem with the code you are
using.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > System.Data.SqlClient.SqlException: Login failed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
Stay green...Green IT