locked
Hide fields in Edit/Insert Mode RRS feed

  • Question

  • User-272643235 posted

    I have four fields in my table to use for auditing:

    ModifiedOn (datetime)

    ModifiedBy (GUID : UserId)

    CreatedOn (datetime)

    CreatedBy (GUID : UserId)

    I don't need to show these fields when user is inserting or updating, but I still need to save those in database.

    What's the best way to do this?

    Thanks!

    Thursday, December 18, 2008 1:12 PM

Answers

  • User-1005219520 posted

    You're in luck - sjnaughton answered this exact question in the last week or two.   Steve has an article on his site showing how to do this with EF.

      I should tell you that it's better to let the DB insert the time (using Default(dateTime)) and use a trigger on insert.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 18, 2008 2:00 PM

All replies

  • User-1005219520 posted

    You're in luck - sjnaughton answered this exact question in the last week or two.   Steve has an article on his site showing how to do this with EF.

      I should tell you that it's better to let the DB insert the time (using Default(dateTime)) and use a trigger on insert.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 18, 2008 2:00 PM
  • User-272643235 posted

     That's exactly what I was looking for... thank you!

    Thursday, December 18, 2008 2:15 PM