Skip to main content

"Login failed for user ''. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)"



Microsoft error messages are sometimes cryptic and in some cases, misleading. This morning I was working on a client server setup at work when I encountered one. So I have two fresh image drive, one for the client and the other for the server. For redundancy, each have their own MS SQL Server installed. The client uses its local database in case of disconnect. After a little configuration, all is almost ready to go. However, final test would reveal its not ready at all.




The Issues
1.  Accessing a shared folder in the client always locks the account I used to login.
2. Connecting to the clients database in the server, gives the "Login failed for user ''" error. The actual message is

"Login failed for user ''. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)"

3. Replication is not working.
4. Event viewer indicates exceptions from System.Data.SqlClient.

The Solution
1. Check if the account you are using to access the client is a valid account.
2. Check if the password used is correct.
3. If all looks ok, follow the following test :
    
    a. Verify that name resolution is working correctly.
  • From a command prompt at the client, ping the server by name and verify that it returns the correct IP address: PING {ServerName}
  • From a command prompt at the client, ping the server by IP address, and verify that it returns the correct server name: PING -a {ServerIP}
  • From a command prompt at the server, ping the client by name and verify that it returns the correct IP address: PING {ClientName}
  • From a command prompt at the server, ping the client by IP address and verify that it returns the correct client name: PING -a {ServerIP}
   b. If the above steps does not reveal any problem, verify that we can access  the logon server:
  • Open a command prompt on the client machine
  • Type "SET logonserver" (without the quotes) and press Enter.
  • On the server, open the command prompt and type "dir \\[ValueReturned]\etlogon" and press Enter. ValueReturned = the value from the SET statement above. The directory listing should not return an error. If it does, troubleshoot that error.
The last step gave an error for me,  it indicated that I could not logon to the logonserver at the client. The username and password was not correct. A little googling lead me to one common reason why this happens, the time on each machine are not the same. Knowing that they are fresh images and that the client time always synchronize with the server time, I hesitantly checked both machines and what did you know, the time and date are different. So I changed the time at the client to match the server. Restarted the machine and the system just ran smoothly as if nothing happened.

Source : Microsoft Help Page




Comments

Popular posts from this blog

Getting Started with Stateless : A Lightweight Workflow Library Alternative for .NET

Image Credit: https://www.pioneerrx.com A year ago, I was looking for a simple workflow manager for a project I was working. Its a medium sized application that involves tracking the state of assets in the system. Back in 2008, Microsoft (MS) introduced new technologies along with the release of Visual Studio 2008: Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), and  Windows Workflow Foundation (WF). Having worked in a company utilizing mostly MS products for development, my first option was to go with WF. After doing some time reading and studying the library, I paused and decided it was too complex for my requirement. Using WF would be an overkill and the fact that it has, a rather, steep learning curve, there has to be another option. My mind toyed with the idea of developing a simple workflow library myself. It would be a learning experience but it might end up consuming a lot of time. Why reinvent the wheel? So I started querying the inte

Hiding Unwanted Python Folders and Files in Visual Studio Code

Visual Studio Code is a universal editor and pretty good at it. However, the explorer view maybe cluttered with the automatically generated folders and files confusing developers. Python is no different. Below are example files and folders generated by Python. The __pycache__ folder and *.pyc files  are totally unnecessary to the developer. To hide these files from the explorer view, we need to edit the settings.json for VSCode. Add the folder and the files as shown below: Copy and paste the lines below : "**/*.pyc" : { "when" : "$(basename).py" }, "**/__pycache__" : true

My First Blog for 2009

Im starting 2009 with a blog on foods. Since my 4 months voluntary exile in the US (hahaha), I started cooking ( full time! ) so Google is my cookbook and I am the chef ( sort of ). Yesterday , I was looking forward for another experiment on the kitchen lab (it gets messy sometimes) . What I have ? Pork belly , Chinese Okra , Squash . I was having doubts on whether the Chinese Okra is the same thing as the vegetable I know from the province , "kabatiti" . So after searching for "kabatiti" on the net , Google returned some informative links on some Ilocano Foods which made my day . Listed below are some Ilocano food worth mentioning . Abrao or Inabrao - assorted seasonal vegetables, typically malunggay, and that quintessentially Ilocano vegetable, saluyot, boiled in a bagoong and fish broth Ipon—tiny fish in season during the cold months Poki-Poki (also poqui-poqui), an innocent omelet made of eggplant sautéed with garlic, onions, tomatoes, and eggs Kabat