He or she may have gotten into something they should not have. Your dog may also have a medical problem that you are not aware of. If your dog has been vomiting for 2 days, he or she is probably Dehydrated, which can become life threatening if your dog is not taken to the vet to get Re-hydrated. Only a veterinarian is qualified to tell you what is causing your dog to throw up and you need to take him or her in and find out what it is and get it treated. The longer you let this go, the worse the situation will become for your dog and the harder it will be for the vet to be able to treat.