SQL Server On Non Standard Ports

If you have an installation of SQL Server on non standard ports, from your code you can connect to it from your code using a standard connection string, but with the addition of creating a ODBC system connection pointing the same SQL Server, and assigning there the custom TCP port.

When you need to connect to SQL Server Management Studio, in the login form you need to use SERVER,PORT.