You've already shot yourself in the foot. You gave into the whining which teaches him that he'll get what he wants if he whines. Do not give into it. Put him in his crate and let him whine as much as he wants. Then get up in the middle of the night to take him outside to potty. After that...