Solved

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

Posted on 2006-10-31
4
227 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
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 500 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now