Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 NT AUTHORITY\NETWORK SERVICE problem

Author  Topic 

parrot
Posting Yak Master

132 Posts

Posted - 2008-07-28 : 15:51:28
I cannot access my SQL database in a browser dialog created in my C# Windows application program I can, however, access the database from a web browser. I get the ubiquitous "Login failed for NT AUTHORITY\NETWORK SERVICE" error message. I researched all the advice on the internet and tried to add an NT AUTHORITY\NETWORK SERVICE login to my database under the Security/Users tab using SQL Server Mangement. However, there is no NT AUTHORITY\NETWORK SERVICE login in my SQL dialog, only an NT AUTHORITY\SYSTEM login. Why is that? Secondly, I finally was able to add an NT AUTHORITY\NETWORK SERVICE manually to my database login and gave it all of the permissions but I still get the error when accessing the database through my Windows browser dialog. Does anyone have a clue as to why I don't have an NT AUTHORITY\NETWORK SERVICE login stored in my SQL setup and what can I do to get around this problem? Below is my connection string.

Provider=SQLOLEDB; Data Source=Vista; Initial Catalog=Mydatabase;Integrated Security=SSPI";

Dave

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2008-07-28 : 21:50:28
To clarify, when you access from opening up Internet explorer it works, but if you use the Active x browser control in .net it does not?

I received a similiar type of error prior nd it was due to the location of my .cs files were on a network share. To resolve this I needed to copy the entire c# project to a non-shared location (i.e. C:\myproject) This will relieve the security issue and should allow it to work. It is a common issue if your mydocuments is a \\shared location rather then a C:\mydocuments due to visual studio wants to create the default storage folder within. Even if it is on the same machine, you will need to copy the solution to a fixed location rather then a \\ network path.

Let me know if this works for you.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-28 : 23:10:23
Looks like you connect to sql server with web service account, possible to specify correct sql login in connection string?
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2008-07-29 : 10:09:32
To simply the explanation I get this error only in a browser dialog that I call from within my Windows application. The other programs or dialog in the Windows application can access the database without error. It just seems to me that it has something to do with accessing a database through a browser dialog of my own creation, not thru IE. I have tried to execute the program from a fixed location outside of the Visual Studio 2005 environment and I still have the problem.
Dave
Go to Top of Page
   

- Advertisement -