SQL Server 2008 - Login failed for user 'user1' The user is not associated with a trusted SQL Server connection

Posted by difek on Stack Overflow See other posts from Stack Overflow or by difek
Published on 2011-02-13T16:47:15Z Indexed on 2012/09/24 9:37 UTC
Read the original article Hit count: 354

Filed under:

I have installed SQL Server 2008 R2 on Windows XP.

In installation process I selected 'SQL Server and Windows Authentication Mode'

When I click right button of the mouse in SQL Server Management Studio on Server -> Security tab 'SQL server and Windows Authentication Mode' is selected.

But when I click on my Database -> Properties - View connection properties Authentication Method is set on Windows Authentication.

To my database was added one user1 with password user1.

But I can't log in to my database from C# (Visual Studio 2008) because error occurs:

Login failed for user 'user1' The user is not associated with a trusted SQL Server connection

What isn't right ?


When I get:

string connectionStr = @"Data Source=rmzcmp\SQLExpress;Initial Catalog=ResourcesTmp;Integrated Security=True";

I have following error:

{"Cannot open database \"ResourcesTmp\" requested by the login. The login failed.\r\nLogin failed for user 'RMZCMP\rm'."}

rm is my original user name on which I log in to my computer. When I get rm I have error:

{"Login failed for user 'rm'. The user is not associated with a trusted SQL Server connection."}

again.

Regards

© Stack Overflow or respective owner

Related posts about sql-server