0

I have done subsequent research on how to connect to SQL Server remotely and even configured it to allow remote connections.

Now I can connect to my sql server instance on remote computer through SSMS but while connecting through my vb.net application I get the exception

Login failed for USER.The user is from an untrusted domain and cannot be used with windows authentication

Please help me to tackle this problem.

Here is my connection string

Server=ACLMUMBAI;Database=Agrichemdb;User ID=xyz;Password=xyz;Trusted_Connection=Yes;

Thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • For one: you should **not** define both `Trusted_connection=yes` (which means: use the current Windows credentials to log into SQL Server) and define `User ID=xyz;Password=xyz` at the same time. Which one is it that you really want?? Use the current Windows credentials, or the UserID/Pwd specified?? Pick **one** - not both – marc_s Jul 27 '12 at 08:39

1 Answers1

0

You could try with

Server=ACLMUMBAI;Database=Agrichemdb;User ID=xyz;Password=xyz;Trusted_Connection=False

Then you need SQL Servers authentication in mixed mode and that there is a SQL Server login as per UserID in above connection string, with matching password and with appropriate permissions against your database.

Let me say also that this solution is not very secure and, if this database is exposed on Internet, you need very strong passwords. And despite this you will get numerous brute-force attacks and unexpected guests.

Steve
  • 213,761
  • 22
  • 232
  • 286