Top DevX Stories
Apple Seeds iOS 4.1 SDK as App Downloads Top 6.5 Billion
Google TV Developer Platform: What to Expect
Here Comes the Decade of the Developer
Red Hat is Still the Best Linux Server Choice
As Oracle Sues Google Over Java, Developers Move to Other Languages
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > ASP.NET

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-17-2005, 12:11 AM
premartha premartha is offline
Registered User
 
Join Date: Oct 2005
Posts: 22
Question SQL server access failed at runtime...

I have made a small ASP.NET application accessing Northwind database in SQL Server on a DIFFERENT computer than the one where IIS is. During development of this application, i gave the valid username and password in process of defining SQLConnection datacontrol, i even tested the connection which was perfect. When i run my application, it says invalid "login failed for user username". what should i do? for sure, username and password are perfectly right for the database.
Reply With Quote
  #2  
Old 11-17-2005, 02:39 AM
srinivas_s srinivas_s is offline
Registered User
 
Join Date: May 2005
Location: UK
Posts: 278
If you use windows login this is how the connection string should be
"server=localhost;database=Northwind;Integrated Security = SSPI"
If you use SQL Server login
"server=localhost;database=Northwind;uid=sa;password=sa"
Since your sql server is on a different machine , where both the machines are on the same domain, and you are using windows authentication, your windows user account should be added to the sql servers users with adequate permissions, Also while defining the SQLConnection if you specified a user name try specifying domain\username in case of windows
__________________
Sri
Reply With Quote
  #3  
Old 11-17-2005, 10:15 AM
pclement's Avatar
pclement pclement is offline
Moderator
 
Join Date: Dec 2003
Posts: 2,750
What level of authentication is your ASP.NET application using? Are you attempting to use a trusted connection with SQL Server?
__________________
Paul
~~~~
Microsoft MVP (Visual Basic)
Reply With Quote
  #4  
Old 11-18-2005, 03:38 AM
premartha premartha is offline
Registered User
 
Join Date: Oct 2005
Posts: 22
Exclamation

Quote:
Originally Posted by pclement
What level of authentication is your ASP.NET application using? Are you attempting to use a trusted connection with SQL Server?
i am sorry, i am very new to this technology. I dnt even know what r different levels of authentication and what is a trusted connection. can u help me giving me any reference to resources regarding this?
Reply With Quote
  #5  
Old 11-18-2005, 08:07 AM
pclement's Avatar
pclement pclement is offline
Moderator
 
Join Date: Dec 2003
Posts: 2,750
You can set up your web application (using Internet Services Manager) for different levels of authentication, such as Anonymous, Basic, Integrated NT, etc). I'm trying to figure out which level your ASP.NET is configured for.

Also, since you're specifying a user ID and password in your connection string it doesn't appear as if you're using a trusted connection (which essentially involves automatically using the identity of the Windows authenticated user).
__________________
Paul
~~~~
Microsoft MVP (Visual Basic)
Reply With Quote
  #6  
Old 11-18-2005, 08:11 AM
premartha premartha is offline
Registered User
 
Join Date: Oct 2005
Posts: 22
it worked now. the problem was in connectionstring property, password was not there. infact, i mentioned user name and password both during setting up my dataadapter. but afterwards, in properties box, i saw it was missing!!

can u suggest me some resources to study on different levels of authentication in detail?
Reply With Quote
  #7  
Old 11-18-2005, 08:20 AM
pclement's Avatar
pclement pclement is offline
Moderator
 
Join Date: Dec 2003
Posts: 2,750
The following should help:

IIS 5.0:
http://www.microsoft.com/technet/pro...tion_modes.asp

IIS 6.0:
http://www.microsoft.com/technet/pro...c7caf61ad.mspx
__________________
Paul
~~~~
Microsoft MVP (Visual Basic)
Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Movingfrom Ms Access 97 to MS SQL Server 97 omar Database 1 03-13-2002 10:40 AM
Help converting ACCESS sql to SQL Server Ted Young Database 4 08-07-2001 10:48 AM
SQL Server Agent wont auto start David Hay Database 2 04-02-2001 07:11 PM
Problems after converting Access DB to SQL Server DB Marie Database 0 11-20-2000 05:37 AM
Remove exchange from a site andriano Enterprise 1 10-02-2000 03:54 PM


All times are GMT -4. The time now is 07:55 AM.


Sponsored Links



Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.