如何使用LINQ to添加在SQL Server 2005时间戳值 [英] How to add Timestamp value in SQL Server 2005 by using LINQ

查看:263
本文介绍了如何使用LINQ to添加在SQL Server 2005时间戳值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库表中有一个名为作为银泰 timestamp列,我使用LINQ插入,在SQL服务器更新数据。现在,我想在我的数据库中添加时间戳值,但我不知道如何插入?

My database table have a Timestamp column named as inTime and i am using LINQ for insert, update data in SQL server. Now i want to add the timestamp value in my database but i don't know how to insert?

 spaBL.attendance obj = new spaBL.attendance();
            obj.FK_employeeId = 1;
            obj.inTime =[what to write here??]

银泰百货是时间戳类型。

推荐答案

您不能更新时间戳。请参见 href=\"http://stackoverflow.com/questions/4592658/sql-server-updating-a-time-stamp-column\">。的确,如TomTom的指示,它不包含实际的时间信息。

You cannot update a timestamp. See here. And indeed, as TomTom indicated, it doesn't contain actual time information.

这篇关于如何使用LINQ to添加在SQL Server 2005时间戳值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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