判断是否为空值


if (js2.Tables[0].Rows[i].IsNull(j))

或者

if (js2.Tables[0].Rows[i][j]==DBNull.Value)


js2是一个DataSet,如果是一个DataTable就直接判断它的Rows即可。


加上判断数据类型为数值型

if (!( js2.Tables[0].Rows[i][j]) is DBNULL) && (System.Convert.ToSingle(js2.Tables[0].Rows[i][j])>0) )
{
//...
}

相关文章:

  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2021-12-10
  • 2021-09-17
  • 2022-01-20
猜你喜欢
  • 2022-01-07
  • 2021-11-02
  • 2021-12-10
  • 2021-04-09
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
相关资源
相似解决方案