c# - Linq to sql and timestamp field -


i've created table timestamp field. allow nulls property set false.
when want update entity repository, null value field, in databse field set value.
knows may problem?
correct values other fields.
thank you.

edit:
when entity repository, timestamp field set appropriately.
problem somewhere in http post:

[acceptverbs(httpverbs.post)] public actionresult edit(product product) 

the value of timestamp field lost here :(

by default, edit view vs generates excludes binary fields. include timestamp field in view, you'll have add view hidden field one:

<%: html.hidden("timestamp", model.timestamp.tostring()) %> 

you'll have add line web.config if compilation error did (using vs 2010):

<add assembly="system.data.linq, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089"/> 

because timestamp.tostring() extension method.

keep in mind cannot explicitly change timestamp field in database. sql server manages that.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -