Can you explain more more detail exactly what you're trying to do, assume that we know nothing about your project. Note that trying to cast a double to a byte makes no sense at all.