【发布时间】:2011-06-11 23:56:17
【问题描述】:
如何检查打开的MySqlDataReader 中的NULL 值?
以下不起作用;它总是打到else:
if (rdr.GetString("timeOut") == null)
{
queryResult.Egresstime = "Logged in";
}
else
{
queryResult.Egresstime = rdr.GetString("timeOut");
}
rdr.IsDbNull(int i) 只接受列号,不接受名称。
【问题讨论】:
标签: c# mysql null dbnull mysqldatareader