February 19, 2007 at 9:18 am
Hi I've got a common error using SQL server 2005
"The user is not associated with a trusted SQL Server connection"
I'm building a application using C# when using a standalone environment, it worked well. But, now I have the following environment.
A.
SQL server
Domain XXX
B. Remote machine
Application
Domain YYY
I changed SQL server to support SQL and WIN authentication mode and I have changed SQl server surface area configuration to support TCP/IP and Named Pipes for remote connections. But I still have two problems:
1. When using the IP - serverName of the dataserver, the error is
System.Data.SqlClient.SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection..
1. When using the server name(MYServerName), I have this error:
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Besides, I have tried from my remote machine to use a sqlcmd -E -S tcp:myhost command but I have the same answer.
Any help, I will thank.
February 19, 2007 at 11:54 am
I forgot to attach my sql string connection:
"Data Source=MyIPServername;Integrated Security=no;Current Language=English;User ID=MyUsername;Password=MyPassword;Initial Catalog=MyDBName;"
February 19, 2007 at 12:15 pm
Sounds like the server is only accepting Windows authentification. Your using a SQL login, but the error says that it's not a trusted login, which means Windows login.
Check the server and change authentification to accept Windows and SQL logins
Markus
[font="Verdana"]Markus Bohse[/font]
February 19, 2007 at 1:16 pm
Thanks to all. I just have resolve the problem. It was my string connection:
string connectionString = "Data Source=MYIP;Initial Catalog=MYDB;User ID=sa;Password=MYSAPASSWORD";
Thanks for your help, anyway.
February 20, 2007 at 12:04 am
Jose,
while this string might work, I would never accept an application on my server which uses the sa account. You should create a SQL login on the server with the necessarey permissions. sa should never be used for applications.
Markus
[font="Verdana"]Markus Bohse[/font]
February 20, 2007 at 4:57 am
Source=MYIP: May I suggest to use for instance a DNS Alias instead of IP hard coding
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply