/// <summary> /// Gets the value of the specified column in its native format. /// </summary> /// <param name="i"></param> /// <returns></returns> public override object GetValue(int i) { if (!isOpen) { Throw(new Exception("No current query in data reader")); } if (i >= FieldCount) { Throw(new IndexOutOfRangeException()); } IMyCatValue val = GetFieldValue(i, false); if (val.IsNull) { return(DBNull.Value); } // if the column is a date/time, then we return a MyCatDateTime // so .ToString() will print '0000-00-00' correctly if (val is MyCatDateTime) { MyCatDateTime dt = (MyCatDateTime)val; if (!dt.IsValidDateTime && connection.Settings.ConvertZeroDateTime) { return(DateTime.MinValue); } else if (connection.Settings.AllowZeroDateTime) { return(val); } else { return(dt.GetDateTime()); } } if (val is MyCatJson) { return(new JsonObject(val.Value.ToString())); } return(val.Value); }