My dog was not eating and throwing up for 7 days and had diaherra. We did take him to the vet several times and we did the what ginger899 said above. And usually what Ginger said works. But not this time... The vet first gave us some TYLAN powder to stop the diaherra, and thats when he started to throw up and not eat. The vet then gave us some medicine for nausea and some peptobismol type stuff, and it didnt work. We put him down cuz he was so sick and had an autopsy done, and he had gallbladder and liver cancer. My dog was 10 years old. WHATEVER YOU DO, DON'T LET THE VET GIVE YOU METRONYZANDOL, if he does, makes sure its in low doses. My dog was poisoned by this and caused nuerolgical issues. He lost use of his legs until taken off of it. Then at the end, his esophagus wasnt working because of the neurological issues. Hope your dog feels better soon.
This may just be a passing stomach upset, it may be a serious infection, or it may be pancreatitis, or something else.....it's impossible for me to tell you.
Probably the best thing to do is to withhold food altogether for 24 hours NO FOOD AT ALL.
Just water. If during this time of no food, your dog is still throwing up, then it could be serious, and at the very least you will be looking at dehydration (which can be very dangerous) So if he throws up more than once when food is withheld, it's time to go to the vet.
But if his stomach settles down, then on the second day, just give plain boiled rice. See how he keeps that down. If all is OK you can add only a little plain boiled chicken or de-boned white fish. Give small amounts at a time, maybe about 4 times a day. On the third day you may be able to give this same food with a little of his dry food added, and gradually introduce his normal food back. Depends how it goes.
Let's hope that works. But do please be very watchful for any signs he isn't getting better, or any real lethargy (wanting to sleep all the time, no energy at all, more vomiting, or if he doesn't drink) Then you should take him to the vet.
Has your dog been eating grass ? How old is your dog ? When was the last time your dog ate ?