How I check If reader has Null value ?
Hi all, I hope your appreciated help.
I need check value of reader, and try this code, I don't have error in the asp net page but when the `reader[0].ToString();` is not null I have the incorrect output: Output --
Thanks in advance.
string top = "--";
if (!top.Equals(System.DBNull.Value))
{
top = "--";
}
else
{
top = reader[0].ToString();
}
reader.Close();
reader.Dispose();
How I check If reader has Null value ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Mar 26, 2012, 7:08 AM EDT
Chevy Mark Sunderland159 reputationPosted Mar 26, 2012, 10:32 AM EDT
I'm really happy for your quickly answer.
Good bye