对象不能从DBNull 转换为其他类型的解决方法

  • Post author:
  • Post category:其他






string sql_str=”select MAX(lID) from liuyan”:改成







语句string sql_str = “select iif((MAX(lID)) is null,’0′,’1′) from liuyan”;







iff(判断,是,否)







但是只能添加一次,因为第二次添加运行string sql_str = “select iif((MAX(lID)) is null,’0′,’1′) from liuyan”;

int lid=DBHelper.GetScalar(sql_str)+1;





版权声明:本文为wxl2012原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。