Posts Tagged ASP.NET Tips

Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’

Few days back,I developed an ASP.NET website in .NET 2.0 with SQL Server 2005 as the back end.  Everything was working fine in the cassini (web server that comes with VS 2005).

After finishing the project, for the testing purpose I thought of publishing it in the real IIS in my local machine.

All went smoothly :) and I was able to view the website locally, but when was I trying to login into the website with the administrator username and password I got something like thisLogin failed for user ‘NT AUTHORITY\NETWORK SERVICE’”

For some reasons I couldn’t understand why this is happening…. But after a googling I found that, this is because of the connectionstring that I used in the web.config :)

If you have created the connectionstring, like below

<add name=”xxxxx” connectionString=”Datasource=servername;Integrated Security=SSPI;initial catalog=xxxx;”
providerName=”System.Data.SqlClient” />

ie you are trying to login into the SQL Server DB using the Integrated Secrity credentials which wrong :)

So you have to explicitly specifiy the user id and password in the connectionstring, like below,

<add name=”xxxx” connectionString=”Data Source=localhost;Initial Catalog=xxx;user id=[userid];password=[password];” providerName=”System.Data.SqlClient”/>

Hope this will solve your issue

10 comments October 16, 2007


Top Posts

Top Clicks

Calendar

November 2009
M T W T F S S
« Jun    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Tags

ASP.NET ASP.NET Tips WPF WPF Blog WPF Controls WPF thirdparty controls

a

Recent Posts

2

Fav links

Feeds

Blog Stats