I use the following line to convert the datarow value into double.
datarow
double.parse(Convert.ToString(datarow));
If the datarow>
datarow>
Another alternative would be to check if the datarow is DBNull:
DBNull
double d = datarow is DBNull ? 0 : double.Parse(Convert.ToString(datarow));
This way, you do not need to check for DBNull.Value
DBNull.Value