How to check if SQLDataReader has no rows

后端 未结 4 719
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-10 23:51

I am trying to figure out how to check if my SqlDataReader is null or has no rows (meaning the reservation does not exist) and then display a messagebox. For so

4条回答
  •  时光取名叫无心
    2020-12-11 00:35

    The HasRows property may help you.

    Property Value

    Type: System.Boolean true if the SqlDataReader contains one or more rows; otherwise false.

提交回复
热议问题