Is there a better/cleaner way to do this?
int stockvalue = 0;
if (!Convert.IsDBNull(reader[\"StockValue\"]))
stockvalue = (int)reader[\"StockValue\"];
>
The shortest (IMHO) is:
int stockvalue = (reader["StockValue"] as int?) ?? 0;
Explanation: