When I drink cold water my teeth hurt with a sharp pain and thenn somethimes with hot water I I have went for a check up for cavities nothing came up.

Sensitive teeth? Teeth can be sensitive for numerous reasons without there being cavities. Young people often have sensitive teeth as the nerve tissue in their teeth react in an extreme manor after they grow in and are exposed to the environment. Older individuals can have small areas of their root surface exposed and there are more nerve ending in that area. So if no cavities, try a sensitivity toothpaste first.
Recession? Recession could be a reason for temperature sensitivity , desensitizing agents can be applied in effected areas by a dental professional use of anti sensitivity tooth past helps also.
Tooth sensitivity. The causes of tooth sensitivity ranges from a simple localized gingival recession and thus exposing the root surface to the local irritants (hot or cold water), to a more complex occlusal trauma (poor occlusion) leads to stretching of periodontal ligament fibers and firing of the a delta fiber (nerve fiber) causing sensitivity reaction. Clean your teeth, apply desensitizer, adjust your occlusion!