如何为DBNull不相等的DBNull [英] How can DBNull not equal DBNull
本文介绍了如何为DBNull不相等的DBNull的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下代码行
if (DBNull.Value.Equals(o) || o != null)
其中, 0
是对象o在row.ItemArray
我不断收到一个错误 - >
where o
is object o in row.ItemArray
I keep getting an error of -->
XML类型列表XDT:untypedAtomic类型不支持从CLR类型转换为DBNull到CLR类型字符串
我不明白是,当我通过我的代码,这步如果
应抓住这一点,我的表演动作交替,但它不?
What I don't understand is that when I step through my code this if
should be catching this and performing my alternate action but it does not?
有人可以提供一些线索给我。
Can someone please shed some light for me.
感谢您!
推荐答案
尝试使用
的 Convert.IsDBNull 方法。
这篇关于如何为DBNull不相等的DBNull的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文