Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Login failed for user domain\user

Author  Topic 

Babaksql
Starting Member

32 Posts

Posted - 2006-05-24 : 08:29:28
I've developed an ASP .Net 2 application. Locally, everything was fine. However, when I deployed it on a remote server. I got this error:

Login failed for user 'domain\userx'.

My connection string is:
connectionString="Data Source=ServerName;Initial Catalog=Aspect;User Id =domain\userx;Password = abc"

I'm quite sure that connection string is fine. I need to mention that whenever I try to connect to the remote server from my client by the Sql authentication, I get the message that login failed for this user. But when I try to connect by windows authentication, it works and there is no error.
I asked the administrator, and he told me that Sql Server authentication is in mixed mode.
So, I really can't figure out what is the problem.

mr_mist
Grunnio

1870 Posts

Posted - 2006-05-24 : 09:49:37
Your connection string is suggesting a windows type user id, but providing a password as if it were a sql id. Unless you have a sql login on the server that actually contains the domain and \ and the username as the sql login name, it won't work. If you want to use windows auth, then your connection string should contain the stuff about integrated security, and not provide a password. If you want to use sql auth, you should make sure that the username matches a SQL login on SQL server.

-------
Moo. :)
Go to Top of Page

Babaksql
Starting Member

32 Posts

Posted - 2006-05-24 : 10:29:09
Thanks mr_mist,

The Adminastrator told me that this user (ourdomain\userx) has been added to the sql users.

Also, when I tried to log in without the user name and password(windows authentication)and with Integrated Security = SSPI in connection string.
I got this error
Login failed for user (null).
Go to Top of Page
   

- Advertisement -