Never respond in a frustrated or angry tone. Why? Because this is the very behaviour you are trying to fix—an adult version of whining.
When your kid starts whining you can whine back teasingly. When your kid sees this, coupled with the absurdity of seeing a parent whining, he will realize that whining is actually a silly thing that gets them nowhere. Reverse psychology, baby!