public int CountMoney() { if (!DBNull.Value.Equals(Eval("LawyerMoney")) && !DBNull.Value.Equals(Eval("OtherMoney"))) { int money1 = Convert.ToInt32(Eval("LawyerMoney")); int money2 = Convert.ToInt32(Eval("OtherMo
有网友回馈说提供的代码有bug.你可以从这个链接下载得到:http://www.cnblogs.com/insus/p/3384472.html 其中有一个Utility,它是把DataTable转换为List<T>的方法: 问题发生在当DataTable字段中有值为NULL时,它会出现异常 > Object of type 'System.DBNull' cannot be converted to type 'System.String'. 异常语句在#27代码.现Insus.NET
平常查询数据 ' 当想要查询 不等于1 的数据的时候,一般会这样查询 ' 此处查询结果没查到所有想要的结果,如果night_flag 列数据为 null时,此行数据是查询不到的. 解决方法一: ' 解决方法二: ' union select * from home where night_flag is null