I have done thousands of D-sub-miniature connectors. I avoid soldering whenever possible. Most uses will tolerate a ribbon cable and IDC style connectors. Soldering even a DE-9 connector will take fifteen minutes to a half hour while you can terminate ribbon cable with a IDC style connector in less than a minute and the only tools you need are a wire cutter and a bench vise. And they are extremely reliable.
D-Sub Connectors | Connectors, Interconnects | DigiKey
In applications where individual wires must be used, I like to use crimp style connectors on individual pins that are inserted in a connector shell. This is far easier and more reliable than soldering if you use the proper, professional crimping tool (Look for brands like Amp, Molex, Greenlee, etc.) Ratchet styles are best, but plain ones are OK if they are FULLY CLOSED for each crimp: they will have a pair of flats that must touch to complete the crimp. No touch = no good.
If you must solder:
00. Fill your coffee cup.
0. USE A MAGNIFIER.
1. Strip wire.
2. Dip stripped end in rosin flux.
3. Tin it and trim to proper length.
4. Hold connector in a vise or other device.
5. Dip trimmed wire in flux again. This provides a small amount of flux for inside the connector's cup.
6. Insert tinned wire in connector's cup.
7. Using a temperature controlled iron with a 1/16 or 1/32 inch tip, heat the cup from below or the side (a SMALL bit of solder on the iron's tip helps a lot here to transfer the heat quickly).
8. After a few seconds of heating, touch the cup and wire with a small gauge, rosin core solder. Only a small amount is needed and it should quickly wick into the cup, around the wire. A small gauge solder will help to prevent solder bridges between pins.
9. Remove solder and iron and hold the wire dead still for about 10 seconds for the solder to harden. This is absolutely essential to prevent a cold solder joint.
10. Visually inspect the joint. The solder should have fully whetted to both the wire and the solder cup. And the surface should be bright, not dull.
11. Repeat for the other terminals.
A temperature controlled iron that is NOT set to the maximum is the best way to get a good solder joint. Too high of a temperature will encourage corrosion while you heat the joint and that can prevent proper whetting with the solder. Use a temperature that is proper for the solder alloy you are using. Again, a small amount of solder on the iron's tip is far better for ensuring rapid heat transfer than setting the iron to a higher temperature.
One more tip: All connectors are not created equal. Get name brand ones no matter what method you choose: you will not regret it.