避免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"]);
posted @   Ready!  阅读(3484)  评论(3编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示