Question in short:
How tot do this in MVC.NET?
Question in long version:
Im trying to use a DateTime column in a SQL Table for version tracking (this in itself is proposed as a solution to re-attaching a Linq2Sql data class after being passedback by a editview for the table)
But now i get 'row not found or changed'-exception. on the ctx.submit:
ctx.appointments.Attach(appointment,true);
ctx.SubmitChanges();
where ctx is my Linq datacontext, appointments my table, and appointment the appointment object i try to attach.. Ive setup the appointments table as sugested here
This problem was also noted by a reader of the suggested solution. He suggested this as a solution.
Problem here is im not using webforms, im using MVC.NET. So i'm guessing using
<%= Html.Hidden("LastUpdate", Model.LastUpdate) %>
makes the LastUpdate property change. So is there a way to make sure i get the same (or at least equal) DateTime object when this is passed back into my update action?
Im using the suggested gettime() trigger on update of my appointments table. this obviously stores an sql datetime object. which might not be precicely parsed by Linq2SQL. I guess this also adds into the problem.
I'm hoping there's a solution for this. I know just using the timestamp format would solve it also.. but that's outside the scope of this question