gastroenteritis is a virus
That depends... How what was what caused? We can't answer you if we don't know what the heck you're talking about! Please tell us what.
By being near someone who is/has been infected recently. Also, Gastroenteritis can be caught by drinking unclean water and not washing your hands after meals and going to the toilet.
Smoking