避免Object cannot be cast from DBNull to other types. 错误

if(sRows[0]["Cycle"].GetType() != Type.GetType("System.DBNull"))//check if DBNull
                            outCycle = Convert.ToInt32(sRows[0]["Cycle"]);
原文地址:https://www.cnblogs.com/silva/p/719444.html