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

this year

.. i will learn new things, perhaps play a new instrument or go back to school.
.. i will find beauty on the open source community.
.. i will read more books and listen to more music.
.. i will pen more poems and possibly write more songs.
.. i will go for new distances and discover new terrains.
.. i will continue to pile running miles to stay fit and healthy.
.. i will strive to be free and make myself available to unknown future.
.. i will go out of my shell more often and be socially more open.

.. i will continue to grow and go with the changes of time.
.. i will be more patient and hopeful to things that may not even be possible.
.. i will be a better son, brother and more importantly a better father.
.. i will be closer with the great beyond.

.. i will continue to repair , refactor and upgrade myself to become a better version of me.

renaming default namespaces for VSTO projects in VS2008

So here is the scenario , you are starting a VSTO project and decided that your default namespace is ExcelAddInTesterApp . You created the project and started coding the project. After several days , your boss called and said "hey marvin , make use of this namespace OurCompany.ExcelAddInTesterApp , we have to add our company name to it got it?" . You get back to your machine thinking its just a simple property just like any project you've been working on. So you right clicked the VSTO project and hit properties . Boom! What the F@#$? The default namespace textbox is disabled!!!!



I've been through this and I googled for ways to do it and ended up with a blog from a Microsoft MVP telling me it can't be done because it is disabled. Then I thought of Refactoring, the beauty and grandeur of the renaming process. I selected the namespace and hit the refactor menu hoping that this would solve the problem . Unfortunately , it did not rather it displayed the message box …

Farewell NU107.5

As I write this blog,  millions of Filipino rock fanatics may have already known what happens after 12:00 midnight tonight. The only surviving station that caters to the rock genre will, sadly, be closing down and permanently signing off tonight. The news came to late to enjoy every second of what is left.  The sad news came to me the last week of October.  Being a follower of the station, I never believed it at first. But online resources would say the station really is nearing its demise.  With several minutes to go, it will be dead air.