I know there are several questions in regards to this already, but I have not found one that seemed to help.
I have tested the connection string in SQL Server Object Explorer and was able to connect to it successfully so I am not sure there is anything wrong with the string.
Please note that for privacy/security the string has been slightly modified but still follows the format of the real string.
After it hits Connection.Open(); it throws the SQL 40 error.
connection = new SqlConnection("Server=prod.domain.com,port#;database=dbname;UID=user;PWD=pw;Trusted_Connection=No;");
connection.Open();