There are many reasons that your dog may have a whining problem. When you learn why they are whining, you will be able to control the problem. A couple of reasons dogs whine are that they are not feeling well, or that they are lacking attention. The whining is simply a form of telling you that's something's not right. Whining due to feeling lonely or in need of attention can be simply cured by spending some time playing with your dog. Dogs that aren't feeling well for other reasons should be taken to a vet promptly.
Dogs also whine at times when they are left at home alone. If your dog is whining when you're not there, it is probably due to separation anxiety. Separation anxiety is something that can be fixed relatively easily. All you need to do is to teach your dog that when you leave the house, you will always return. Start by leaving the house for one or two minutes at a time, slowly work this up to 10 minutes and then half an hour once your dog gets accustomed.
However, should you make a fuss when you come back or you fawn over the dog as you are leaving, you will find that you're leaving takes on a new meaning, it becomes a big deal. Do not get overly excited when you leave and pay attention to your dog only after you have been in the house for a while. This lets your dog know that your leaving is a normal occurrence, you will return and it is no big deal.
Once you have practiced this method with your dog and he can tolerate being alone for ten minutes or so, start to increase this time in 5 minute slots until you are away for an hour or more. You dog will slowly learn that you coming and going is normal behavior and it won't be as difficult for him.
Another way, which is a controversial way to control the whining in your dog is to completely ignore your pet, however this may not be a good idea as the dog may have some underlying physical problem that you should be aware of. Instead you may want to try giving the dog a firm command to stop this behavior and then you must back it up with negative reinforcement. You may try a loud noise that is very unpleasant during the time when she is whining, making her associate this noise with her whining.
Even if your dog's whining is driving you crazy, never resort to physical punishment. Abuse is not an effective form of training and it's also against the law. It can have many harmful effects on your dog, more than just the pain of the abuse. The best way to get lasting results when training your dog is to treat it with love and firm but fair respect.