简体   繁体   English

使用SQL Server 2005 Datetime作为实体框架的日期

[英]Using SQL Server 2005 Datetime as Date with Entity Framework

We're working with Entity Framework 4 but we're being told the database to use is SQL Server 2005 even though we seem to have licenses for 2008R2. 我们正在使用Entity Framework 4,但我们被告知要使用的数据库是SQL Server 2005,即使我们似乎拥有2008R2的许可证。 Notably, SQL Server 2005 seems to be missing a 'date' type, which has been requested in the requirements. 值得注意的是,SQL Server 2005似乎缺少“日期”类型,这已在需求中请求。

For the purposes of keeping the rest of the application the same in case we move to SQL Server 2008R2 later, is there some way to semi-automatically treat a datetime type as a date in the rest of the application via Entity Framework 4? 为了在以后转移到SQL Server 2008R2的情况下保持应用程序的其余部分相同,是否有某种方法可以通过Entity Framework 4半自动将日期时间类型视为应用程序其余部分中的日期?

I use SQL SERVER 2008R2 and date type. 我使用SQL SERVER 2008R2和日期类型。 It is easly mapped to DateTime in Entity Framework 4. So there will be no problem in any case. 它很容易映射到Entity Framework 4中的DateTime。因此在任何情况下都不会有任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM