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 Search this Thread Display Modes
  #1 (permalink)  
Old February 14th, 2007, 06:29 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Funky - Login Failed for user 'Domain\UserId' erro

I am using VS 2005, Visual Source Safe, IIS 5.1, SQL Server 7 for sample web application.
IIS and SQL Svr resides on Win2K server over network.
I added user MachineName\ASPNET in SQL Server with public, db_datareader, db_datawriter privileges. In addition I gave Select, Insert, Update,Delete privileges on tables and Execute permission on procedures it suppose to use.

connection string is in webconfig file
server=11.11.11.11;database=MyDBName;Integrated Security=True;

Web App works fine from VS IDE. I published on IIS server, it works fine. Another programmer shares my same code thru VSS. He belongs to different domain in network.
When he run using VS IDE he gets error
Cannot open database requested in login 'MyDBName'. Login fails. Login failed for user 'DomainName\HisUserID'

When he runs the published site on the IIS server, he does not get any error!!
So he gets error whenever he runs using IDE!!

Do I need to give db_datareader, db_datawriter privileges to ASPNET account? Permission to specified tables and procedures aren't sufficient?

Imar, I do have your excellent document on which account is used under IIS.

Thanks in advance.
KD



Reply With Quote
  #2 (permalink)  
Old February 14th, 2007, 06:42 PM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Did you also see this? http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #3 (permalink)  
Old February 21st, 2007, 01:15 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar,
I have thru yours excellent document. I think you should add more detail on VS2005 IDE web server cassini.
In my case, developer machine is in Domain1 and our dev server (hosting IIS and SQL server) is in another domain. My machine and other developer's machine is in SAME domain.

I verified user in sql server. Only difference in you steps and mine is that I created the user MachineName\ASPNET directly under the database I am using. Your document ask to create user in SQL server instance first with 'windows login' and default 'master' database. In next step, create the same user under the database that is being used and give db_datareader, db_datawriter role. The MachineName\ASPNET account I created in my database has public, db_datareader, db_datawriter role and SELECT, INSERT, UPDATE, DELETE permission on the tables plus EXECUTE permission on necessary procedures.

I verified on sql server that TCPIP and NamedPipe are enabled using SQL Network utility.

Still I do not get any error but other developer get error when he runs the same code from VS 2005 IDE!!

Any help?

KD

Reply With Quote
  #4 (permalink)  
Old February 24th, 2007, 11:02 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Sorry I missed this post earlier.

Anyway, I don't really understand you. Is your database somewhere else in a different domain? If that's the case, you can't use integrated security directly. You could either create a trust between the domains, or use SQL Server authentication.

Regarding cassini: there isn't much to add. With cassini, your own local account (Machine\YourUserName is used. From there, everything is the same as with other accounts.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Not Enuff Love by Faithless (Track 2 from the album: Outrospective) What's This?
Reply With Quote
  #5 (permalink)  
Old February 26th, 2007, 01:18 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SQL Server reside on machine in different domain.
I checked with my network administrator.
There is trust relation between two domains.

Kd

Reply With Quote
  #6 (permalink)  
Old February 26th, 2007, 01:38 PM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

This may be an issue where the other account isn't propagated from the original work station to the web server to the database server.

You may need to enable kerberos authentication, although for me it's hard to tell if you really need that as I don't know the exact details of your network and setup.

Search Google for kerberos and hop and see if that brings up anything useful for you.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 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



All times are GMT -4. The time now is 09:50 AM.


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