现在的位置: 首页 > 综合 > 正文

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

2011年03月19日 ⁄ 综合 ⁄ 共 148字 ⁄ 字号 评论关闭
if(sRows[0]["Cycle"].GetType() != Type.GetType("System.DBNull"))//check if DBNull
                            outCycle = Convert.ToInt32(sRows[0]["Cycle"]);

抱歉!评论已关闭.