views:

89

answers:

1

I have a web app that I am working with on a separate server. I didn't originally create it, but I have to maintain it. I had to to do some manual editing of one of the database tables, which I did through Visual Studio 2008 installed on the same machine. Now I get SQL exceptions regarding Network Service not having the right privileges.

How do I avoid this from happening? I haven't modified any settings regarding the security or access information. It was working before I made the modification, and now it isn't.

Thanks!

A: 

Did you by chance change the connection information stored for the DB? Perhaps remove a explicit user (SQL Authentication) and replace it with a Trusted_Connection?

Also did you change the webserver to no longer use authentication?

The error sounds like it is coming from the fact that the Network Service account (the one generally responsible for running ASP.NET pages) cannot access the DB. This happens mostly when authentication is disabled, and there is no explicit SQL Authentication.

GrayWizardx
I am new to the .NET side of the world, and I ran into this problem before when I tried copying over a modified version of an mdf file. I had to restore it from backup and restart the computer.To answer your question, I didn't change anything intentionally. I know that when I tried accessing it through the website project open in visual studio, it complained about SQLEXPRESS not being installed. I had to just add a new connection to it through the VS server explorer and used Windows Authentication to access it.
Casey
Windows authentication requires a user with access to the MDF, like an admin. In this case the default ASP.NET user is Network Services. You can provide connection info in a few places. 1) In the app itself inside the conenction string, 2) In the config file using the ConnectionStrings section, and 3) in the Web site config using IIS. Without seeing the connection method used currently, I cant really give any more detailed info.
GrayWizardx
Thanks for the input. I will get this information and provide it this evening.
Casey