Posts tagged ‘ASP.NET’

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

October 16, 2007 at 2:33 pm 14 comments


Top Clicks

  • None

Calendar

July 2017
M T W T F S S
« Jun    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Recent Posts

Feeds

Blog Stats

  • 93,036 hits