开发者

problem to find out the string is null or not

开发者 https://www.devze.com 2022-12-29 14:31 出处:网络
in mysql default null value is (NULL) when i try to use it in c# that code not work because it is a string who have a开发者_StackOverflow社区 value \"(NULL)\"

in mysql default null value is (NULL)

when i try to use it in c# that code not work because it is a string who have a开发者_StackOverflow社区 value "(NULL)"

how i can check that string is null or not. if i check by string.insnullorempty or ==null it's not worked

how can i check this row is null or not in c#


if (dbval == System.DBNull.Value)


Is it possible that you have some configuration problem (e.g. wrong SQL in 'create table' statement) for which mySql is returning you a string containing "(NULL)" instead of a null value?


String.IsNullOrEmpty() - should help IMO...


Ok, so have you tried string.IsNullOrEmpty() or using a comparison like myValue == NULL?

0

精彩评论

暂无评论...
验证码 换一张
取 消