My database table have a Timestamp column and i am using LINQ for insert, update data in SQL database. Now i want to add the timestamp value in my database but i don’t know how?
I seems various examples on net and they didn’t write any code for inserting value in database it automatically inserted on insertion data. while i saw in the table there is also no default value assign then how timestamp insert into database by uisng LINQ??
I assume you mean that you have a table with a column that has a Timestamp data type. My answer assumes this is what you mean.
You do not provide values for columns with a Timestamp (Rowversion) data type. SQL Server will provide a value for you automatically (and it won’t be a datetime value). Therefore you do not need to be concerned with having Linq To SQL insert a Timestamp value for you. In fact, you cannot do it. SQL Server will do it for you. You can however, retrieve the value of a Timestamp column. I believe the corresponding C# type will be System.Data.Linq.Binary.