sql server connect:
I've been having a problem connecting to my sql 2000 server database.
The error reads...
Server Error in '/ASP' Application.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for
user 'NT AUTHORITY\NETWORK SERVICE'.
Source Error:
Line 30: //{
Line 31: Response.Write("before the open");
Line 32: objConn.Open();
Line 33: //SQLConnection.Open();
Line 34: //SqlCommand objCmd = new SqlCommand(sql,
objConn);
My web.config file reads:
<configuration>
<appSettings>
<add key="Andrew" value="Data Source=localhost;Initial
Catalog=Andrew;User Id=xxxx;Password=xxxxxxxxx"/>
</appSettings>
<system.web>
<compilation defaultLanguage="C#" debug="true" />
<customErrors mode="Off" />
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
</system.web>
</configuration>
My connection string in my C# file reads...
protected SqlConnection objConn = new
SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["Andrew"]);
What I've done so far:
Under security in SQL server I've set up an account with the ID. It
shows type as Standard, Server access as Permit and Default Database as
Andrew.
Under my SQL Server Login Properties I've set the Authentication to
"SQL Server Authentication" and entered the password.
Under the defaults menu I've set the database to Andrew.
Under server roles "System Admins" is checked.
Under the Database Access tab my user ID is assigned to the
"Andrew" database with a checkmark in the permit box.
Database roles for Andrew are set to public and db_owner.
I can't seem to find my way around this error. Any help would be
greatly appreciated!
Thanks,
Andrew