By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,510 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,510 IT Pros & Developers. It's quick & easy.

C#/SQL Server: Connectivity issues with a SQL/C# made fake login name

P: 6
Hi all,
I keep getting a bizarre login error, when trying to connect to a SQL Server 2005 database on a local domain to my machine using C#. The Exception returns:
SQLException: Login failed for user 'OURDOMAIN\PC-DAVIDC$'.
Where "OURDOMAIN" is the domain my computer is connected to, and "PC-DAVIDC" is the computer name.

What's weird about this though, is this isn't in the connection string. Nor is it a valid NT account on the Active Directory my computer is connected to, or on the local machine itself. I have absolutely no idea where C#/SQL Server is getting this fake login from.

Does anyone know what might cause this kind of issue? It baffles me as to why it's saying "OURDOMAIN\PC-DAVIDC$", and not "OURDOMAIN\David Costello" which is the actual NT account it would usually log in with.
I don't even know what to google for, to look up this issue. :S

The connection string in question is, and has always been:
Data Source=SRV-DB01;Initial Catalog=Development;Integrated Security=SSPI;

The c# connectivity code isn't really an issue, as it connects fine to other databases on the same server. My account has permission to access the database in question. Nothing has really changed in the past few days since it was working fine. It's just utterly bizarre.

Any advice would be much appreciated.
Apr 25 '07 #1
Share this Question
Share on Google+
2 Replies


Motoma
Expert 2.5K+
P: 3,235
Am I understanding you right? The code will connect to other databases on the same server, but just not that particular one?
Apr 25 '07 #2

P: 6
Am I understanding you right? The code will connect to other databases on the same server, but just not that particular one?
Indeed.
I wanted to try and edit the post to refresh what I'd written, but I can't seem to edit it any more. :S

I didn't mention I was running the code in question as a Windows Service, and it would appear the problem laid in the fact that the service was running under the local system user account, instead of under a domain administrator account.

The problem seems to be fixed now. :)
Apr 26 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.