DBNull if statement

前端 未结 9 1538
再見小時候
再見小時候 2020-12-01 13:55

I\'m trying to execute a stored procedure and then use an if statement to check for null values and I\'m coming up short. I\'m a VB guy so please bear with me if I\'m making

9条回答
  •  攒了一身酷
    2020-12-01 13:58

    I use String.IsNullorEmpty often. It will work her because when DBNull is set to .ToString it returns empty.

    if(!(String.IsNullorEmpty(rsData["usr.ursrdaystime"].toString())){
            strLevel = rsData["usr.ursrdaystime"].toString();
        }
    

提交回复
热议问题