public override object GetValue(int i)
{
if (!isOpen)
Throw(new Exception("No current query in data reader"));
if (i >= FieldCount)
Throw(new IndexOutOfRangeException());
IMySqlValue val = GetFieldValue(i, false);
if (val.IsNull)
return DBNull.Value;
// if the column is a date/time, then we return a MySqlDateTime
// so .ToString() will print '0000-00-00' correctly
if (val is MySqlDateTime)
{
MySqlDateTime dt = (MySqlDateTime)val;
if (!dt.IsValidDateTime && connection.Settings.ConvertZeroDateTime)
return DateTime.MinValue;
else if (connection.Settings.AllowZeroDateTime)
return val;
else
return dt.GetDateTime();
}
return val.Value;
}