当我在 Oracle 日期字段中插入 maxdate 时:
using (OracleCommand Cmd = new OracleCommand("insert into test (mydate) values (:mydate)", OracleConnection))
{
Cmd.Parameters.Add(new OracleParameter(":mydate", DateTime.MaxValue));
Cmd.ExecuteNonQuery();
}
并尝试检索值:
using (OracleCommand Cmd = new OracleCommand("select mydate from test where mydate=:mydate", OracleConnection))
{
Cmd.Parameters.Add(new OracleParameter(":mydate", DateTime.MaxValue));
object MyDate = Cmd.ExecuteScalar();
}
MyDate 对象保持为空。这意味着它不能读回记录。这是一个错误吗?某处舍入不匹配?