Trying to debug a customer's connection problem when they try specifying the SQL Server port.
Reproducing the issue locally I checked and my server runs under the default 1433 port. Specifying that port using:
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = "servername,1433";
builder.InitialCatalog = databaseName;
builder.IntegratedSecurity = false;
builder.UserID = userName;
builder.Password = UserPsw;
This fails with "Login failed for user". If I remove the port number, it connects fine. Why does this happen?
By the way the same happens with Windows Integrated Security.
And one more piece of information: I do run also a SQL Server 2005 express SQL server on the same box.