Generally most mesozoic dinosaurs didn't live in water. For the most part they were land creatures.
It is now known that birds are theropod dinosaurs. There are some birds that spend a lot of time in water like penguins and the extinct Hesperornithiformes. Ducks spend a lot of time floating on water.
There where other animals living in oceans during the Mesozoic called Plesiosaurs and Icthyosaurs. These are NOT dinosaurs.
Examples of these creatures:
Plesiosaurs:
Elasmosaurus
Liopleurodon
Icthyosaurs:
Shonisaurus
Cymbospondylus