?
Solved

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

Posted on 2006-10-31
4
Medium Priority
?
235 Views
Last Modified: 2010-04-16
I Changed the connection string in my code to disable annonomys access and use Trusted_Connection instead..

Hence i changed the following Connection string :
[global::System.Configuration.DefaultSettingValueAttribute("server=NICEDEV1;user id = NICEPLANDEV; password=****; database=NICEContacts")]

To:

[global::System.Configuration.DefaultSettingValueAttribute("server=NICEDEV1;database=NICEContacts;Trusted_Connection=yes")]


the reason I did this is because i need to be able to know the identity of the user logging in so that i can use this in Audit trail.. hence i can trace what each user has done in terms of changes  and use this Machine authentication to Store his details against a row that is changed..

The problem is i get the following error when i use the second connection string..

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

I have even unchecked the enable Anonomys access option in IIS for this project..

Please help..

0
Comment
Question by:Collindsouza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 2000 total points
ID: 17843464
now open the web.config file and add the following line

<identity impersonate="true" />

right after
 <authentication mode="Windows" />
0
 
LVL 5

Author Comment

by:Collindsouza
ID: 17846509
i tried adding <identity impersonate="true" /> immediately after <authentication mode="Windows" />
.. i still cant get it working
0
 
LVL 12

Expert Comment

by:sandip132
ID: 17847323
try using sql server IP instead of NICEDEV1.
0
 
LVL 5

Author Comment

by:Collindsouza
ID: 17848800
when i use the IP instead of the server name.. i get the following error

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

i checked the default settings and the part Allow remote connections is checked...

please help
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question