Groups | Blog | Home
all groups > dotnet ado.net > june 2006 >

dotnet ado.net : Login failed for user 'NT AUTHORITY\NETWORK SERVICE'



mark.norgate NO[at]SPAM gmail.com
6/30/2006 7:48:06 AM
I'm using ASP.NET 2.0 and Windows Server 2003.

A common problem it seems, and I've followed all the advice on the
world wide interweb but I still get the following message:

Cannot open database requested in login 'verfiy'. Login fails.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

I've added VERIFY\IIS_WPG to the Verify database users, as well as NT
AUTHORITY\NETWORK SERVICE, just to be on the safe side, assigned them
both the db_owner role, but still get the above error. My connection
string looks like this:

Server=localhost;Database=verfiy;Trusted_Connection=True;

What am I missing?

Ta, Mark
mark.norgate NO[at]SPAM gmail.com
6/30/2006 8:08:24 AM
It's already set to use "SQL Server and Windows" authentication.

Mark

[quoted text, click to view]
Sahil Malik [MVP C#]
6/30/2006 10:55:44 AM
You need to use SQL Server authentication instead of Windows authentication.
There are ways to use Windows Auth with ASP.NET, but changing over to SQL
Server auth. is the simplest quickfix to your problem.


--
- Sahil Malik [MVP]
http://blah.winsmarts.com


[quoted text, click to view]

Sahil Malik [MVP C#]
6/30/2006 1:02:38 PM
That's your SQL Server - but your connection string still uses Windows.

- Sahil Malik [MVP]
http://blah.winsmarts.com




[quoted text, click to view]

Miha Markic [MVP C#]
6/30/2006 6:51:56 PM
Hi Mark,

Just to make sure - is your asp.net app on the same machine as database?

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

[quoted text, click to view]

mark.norgate NO[at]SPAM gmail.com
7/5/2006 4:35:15 AM
Yep, it is.

[quoted text, click to view]
mark.norgate NO[at]SPAM gmail.com
7/5/2006 4:36:00 AM
Oo, really? So how I modify it for SQL authentication?

[quoted text, click to view]
Sahil Malik [MVP C#]
7/5/2006 10:09:49 AM
www.connectionstrings.com <--- check that site out :)


--
- Sahil Malik [MVP]
http://blah.winsmarts.com


[quoted text, click to view]

AddThis Social Bookmark Button