How can I prevent dehydration in my child that is infected with e.Coli?

Small sips. Small, frequent sips of liquids. Once ounce every 15 minutes. Popsicles can help too but don't use too many because too much juice/sugar can make diarrhea worse. Take your child to the doctor if s/he cannot keep down liquids, has had no urine output in 8 hours or has had less than three urine outputs in 24 hours.
Dehydration. The key to any hydration therapy is to replace fluids lost in a sensible manner without over- or undergoing it. Avoid large amounts of fluid at one time. Sports drinks contain a lot of sugar and can make the diarrhea worse. Look for signs such as hollow, sunken eyes or skin on your child that doesn't "snap" back when you pluck it. If you have an infant, administer small doses of fluids at a time.