Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 600349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:35:46+00:00 2026-05-13T16:35:46+00:00

Question in short: How tot do this in MVC.NET? Question in long version: Im

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:35:47+00:00Added an answer on May 13, 2026 at 4:35 pm

    I think the problem is that writing out the last update time into a hidden field like that will just do a ToString on the date which by default won’t render out the milliseconds. You could try rendering out the timestamp as some absolute value such as ticks:

    <%= Html.Hidden("LastUpdate", Model.LastUpdate.Ticks) %>
    

    You can then reconstruct your datetime on the other side by converting the value back into a long & reconstructing the DateTime:

    var dt = new DateTime(Int64.Parse(ticks));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short Question: What's the best date format to use in SQL Server? Long Explanation:
Short question: Do any of MS's built in Data Objects support INotifyPropertyChanged? Long explination:
Short question: is there a way to access the datatypes available in .net application
Short Question: Basically I am trying to add a scalar property to my entity
Very short question. Can anyone say why this query select LENGTH(' '::char || '
The short question: I want to be able to use the path of the
The short question: how can I (or is it possible to) make use of
Short question: How can I use createLink in a Filter? I'm getting error: No
Short question: How does IIS know if a request is webforms or MVC?
Short Question Is there a setting with git to allow a clone to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.