> I am assuming this is an asp.net app as you mention web requests. I would be
> surprised if the machine name is incorrect. It is more likely the security on
[quoted text clipped - 16 lines]
> >
> > the system work fine before i had reload it.
> i am using server=localhost;Trusted_Connection=true;
> What else do i have to do?
[quoted text clipped - 20 lines]
>>>
>>>the system work fine before i had reload it.
Stan,
The solution to this problem depends on a few things.
Is your web application using Windows Security, or does it use Web Forms
or anonymous access? If you're trying to pass along the credentials
from the end user to the database (to limit database activity based on
known users), you'll need to make sure you've got impersonation enabled
in the Web.config (search MSDN and you'll find out how to do this).
If you're just using a single login to manage all database calls, then
you'll need to configure SQL Server to allow the NETWORK SERVICE user
access.
If the database and web server are on the same box, then just ensure
that the NT AUTHORITY\NETWORK SERVICE user has been granted permissions
on the database that you are accessing.
In SQL Enterprise manager, navigate to the database that you're trying
to access. Look under Security and add a new login. Choose Windows and
then select the "NT AUTHORITY\NETWORK SERVICE" user from the list (if
it's not there, you should be able to type it in).
Within the database, grant this user permissions to use the database (I
strongly suggest that you choose individual permissions rather than make
this user a "dbo" (database owner).
You have two other options. If the SQL Server and the Web server are on
separate machines (assuming they are in the same Windows domain), you
can change the user that IIS uses to execute your web application.
You'll do that from Internet Services manager. Tinker with the settings
and see if you can figure it out. If not, I'll tell you.
Once you change the user that IIS runs your application as, you'll need
to add this user to SQL server and grant the appropriate permissions.
There is another way...
If you have configured SQL server to allow "mixed mode" security, then
you can create a SQL login for your database and change the connection
string to use SQL security rather than Trusted. You then add your new
user credentials to the connection string ("uid=username;pwd=password;").
This is WAAY more information than you needed, but the answer is in
there somewhere. ;)
Michael Earls