【发布时间】:2015-01-04 12:39:59
【问题描述】:
我正在编写一个通过 SQL 查询读取 Oracle 表的 VB.Net 代码。
SQL 查询可能会返回一些空列。我正在尝试检查这些列是否为空,但我收到错误 Oracle.DataAccess.dll 中出现“System.InvalidCastException”类型的异常,但未在用户代码中处理。该列包含一些 Null 数据
这是我的代码:
Dim Reader as OracleDataReader
'Execute the query here...
Reader.Read()
If IsNothing(Reader.GetDateTime(0)) Then 'Error here !!
'Do some staff
end if
请问有人知道如何检查列是否为空吗?
谢谢
【问题讨论】: