【发布时间】:2012-06-08 09:24:26
【问题描述】:
在 nhibernate 中我使用以下来比较日期
Restrictions.Eq(Projections.Property("SubmittedDate"), request.Data.SubmittedDateTime.Value)
在本地环境中它的工作。但在其他环境中它不返回结果。
SubmittedDateTime? is nullable
我是否需要在映射文件中的某处提及可为空。
为此我需要对代码进行任何更改吗?
【问题讨论】:
-
您还需要比较时间吗?如果没有,请尝试使用 request.Data.SubmittedDateTime.Value.Date。试试看这个帖子:stackoverflow.com/questions/2872444/…
-
SubmittedDateTime 是什么数据类型?使用什么sql类型?
-
SubmittedDateTime 是 C# 可为空的日期时间类型。 SQL 类型为 (Datetime,null)
-
@StefanSteinegger SubmittedDateTime 是 C# 可为空的日期时间类型。 SQL 类型为 (Datetime,null)
标签: sql-server-2005 nhibernate nhibernate-criteria