how to check if a datareader is null or empty

前端 未结 12 1768
谎友^
谎友^ 2020-12-24 01:52

I have a datareader that return a lsit of records from a sql server database. I have a field in the database called "Additional". This field is 50% of the time emp

12条回答
  •  醉酒成梦
    2020-12-24 02:35

    First of all, you probably want to check for a DBNull not a regular Null.

    Or you could look at the IsDBNull method

提交回复
热议问题