📅  最后修改于: 2022-03-11 14:49:00.310000             🧑  作者: Mango
int? stockvalue = null;
if (!Convert.IsDBNull(reader["StockValue"]))
stockvalue = (int)reader["StockValue"];
//Then you can check
if(stockValue.HasValue)
{
// do something here.
}