Bill, I use the following general routine when dealing with a datareader. If
you are working with a strongly typed report, you will find a
row.Is<fieldname>Null() method generated for you...Chuck
private string GetDBDateString(string fieldname)
{
int index = dr.GetOrdinal(fieldname);
if (dr.IsDBNull(index))
return "";
else
return dr.GetDateTime(index).ToShortDateString();
}
"BillG" wrote:
I am trying to read in values from a table. When a value is null in the
table what is the proper way to handle it.
ex.
Owed.DatePaid = Convert.ToDate(row("DatePaid"))
for some rows DatePaid in the table could be null.