Solved

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

Posted on 2006-10-31
4
231 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

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

Suggested Solutions

Title # Comments Views Activity
What is "public object" in C#? 3 65
Video Player 12 28
HTML - Color not displaying correctly in EMAIL. 6 49
Release Dynamically Allocated Memory in C# 3 38
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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