DateTime2和Sql Server 2005的问题 [英] Problems with DateTime2 and Sql Server 2005

查看:81
本文介绍了DateTime2和Sql Server 2005的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好! (再次)
在学习编程的无尽道路上,我遇到了另一个问题:
我一直在使用Visual Studio 2010和Sql Server 2008开发应用程序.一切正常,直到我从SQL Server 2008(在家中)更改为SQL Server 2005(在Office中).正如我在Google上发现的那样,问题似乎是Sql Server 2005不支持DateTime2.
有什么方法可以将DateTime2强制转换或转换为单个DateTime?

我正在使用ADO.NET实体框架在数据库上插入和更新记录.

提前谢谢.
最好的问候.


可能的解决方案:
好吧,我已经从SQL Server 2005数据库中重新生成了模型,尽管它是一个有效的解决方案,但现在仍然可以运行,但是效率不高,因为我使用的是SQL Server 2005,而不是2008定期开发我的应用程序.
如果有更好的方法来解决问题,那就好.
无论如何,都要感谢aspdotnetdev的回答.

Hi everyone! (again)
On the endless road of learning programming, I ran into another problem:
I''ve been developing an application with Visual Studio 2010 and Sql Server 2008. Everything worked fine until I''ve changed from SQL Server 2008(In my Home) to SQL Server 2005 (In the Office). The problem seems to be, as I found on Google, that Sql Server 2005 doesn''t support DateTime2.
Is there any way to cast or convert from DateTime2 to the single DateTime?

I''m using ADO.NET Entities Framework to insert and update records on the DB.

Thanks in advance.
Best Regards.


A Possible Solution:
Well I''ve regenerated the model from the SQL Server 2005 Data Base and now works, although of being an effective solution, isn''t efficient, because I''m depending on SQL Server 2005 rather than 2008 that is what I use regulary to develop my applications.
If there is a better way to solve the problem would good.
Anyway thanks to aspdotnetdev for the answer.

推荐答案

您总是可以让两个数据库都使用datetime并完全停止使用datetime2.
You could always have both databases make use of datetime and discontinue use of datetime2 altogether.


这篇关于DateTime2和Sql Server 2005的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆