我有下面的代碼行如何爲DBNull不等於DBNull的
if (DBNull.Value.Equals(o) || o != null)
其中o
爲object o in row.ItemArray
我不斷收到的錯誤 - >
Xml type "List of xdt:untypedAtomic" does not support a conversion from Clr type "DBNull" to Clr type "String".
我也不是什麼理解是,當我通過我的代碼時,這if
應該趕上這一點,執行我的替代動作,但它不?
有人可以爲我散光。
謝謝!
你能發佈一些更多的代碼嗎? o哪裏得到分配? – hackerhasid 2010-01-13 21:03:30
Console.WriteLine(o.GetType()。Name);'?的結果是什麼? – jason 2010-01-13 21:10:03
我認爲這有點奇怪,首先你與DBNull比較,然後與非空 – tga 2010-01-13 21:18:38