如何SQL时间戳在.NET比较? [英] How to compare SQL timestamp in .NET?

查看:176
本文介绍了如何SQL时间戳在.NET比较?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经映射实体框架的实体。在SQL Server 2008中的每个表包含了被映射为字节数组timestamp列。数组的长度始终是8。

I have mapped Entity framework entities. Each table in SQL Server 2008 contains Timestamp column which is mapped as byte array. The length of array is always 8.

现在我需要在.NET比较时间戳值。我来了两个解决方案,但我不知道哪一个更好?

Now I need to compare timestamp values in .NET. I come with two solutions but I don't know which one is better?

  • 比较它的阵列。当第一个字节对是不同的返回假的。
  • 在转换字节数组长,比较多头。

哪种解决方案更好?或者有没有其他的解决办法吗?

Which solution is better? Or is there any other solution?

推荐答案

我们通过比较它们的字节数组做到这一点。对我们工作的罚款。

We do it by comparing them as byte arrays. Works fine for us.

这篇关于如何SQL时间戳在.NET比较?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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