Problem with connection from ASP to SQL server

  • Thread starter Thread starter Bobofrut
  • Start date Start date
B

Bobofrut

Hi
I have a problem, when I try to connect to the MS SQL SERVER from my
workstation ocourr the error message:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

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
'(null)'. Reason: Not associated with a trusted SQL Server connection.

Source Error:

Line 39: SqlConnection mycon = new SqlConnection();
Line 40: mycon.ConnectionString=constr;
Line 41: mycon.Open();

--------------------------------------

My connection string is:

string constr="data source=SERWER-NT;initial catalog=Egzaminy;integrated
security=SSPI;persist security info=False";

From VS.NET in my workstation I connecting without problems(my user i added
to the security base in server). In SQL SERVER security is set to "Windows
only".

Anyone can help me?

thank
Chris
 
Give the ASPNET account access to your database in SQL Server.

Hope this helps,

Mun
 
Usually when I've seen this it is because you are using a trusted connection
but the web box is in a different domain (or not in a domain) from the SQL
Server box.

The only ways to fix that problem are to:
1) Put the web box into the same domain (if you are using domains)
2) Switch to using a SQL id instead of using a trusted connection.

Jeff
 
Back
Top