For numerics 0 is empty. You'll have to handle them differently. If you want generic code you will need to check data type of the value first and then either assign null or not accordingly. The other types that act this way are double, interger, and currency.