I have a C# application that connects to a SQL server with SQL authentication, but the machines that are to be using it aren't on the domain.
I've been trying to solve this for several days now. On my development machine the connection string works perfectly fine and isn't using Windows authentication. As soon as it is on one of the others outside the domain, including non-domain accounts on my machine, this error occurs.
login failed. the login is from an untrusted domain and cannot be used with windows authentication. Error: 18452
The connection string is (details omitted and edited for readability):
Data Source=[servername];
Initial Catalog=[Database];
Persist Security Info=True;
User ID=[username];
Password=[password];
TrustServerCertificate=True;
I've also tried additional string options such as Trusted_Connection (tried true and false) and Integrated Security=SSPI.
All the server connection settings are correct (allow remote connection, ports, both Windows and SQL authentication allowed), and I can connect to the server on SSMS using the username and password just fine.
Assuming my settings are correct (there's bound to be something wrong somewhere), doesn't this defeat the point of using a SQL user login if I can't log in remotely? Anyway, any help is appreciated.