How to ask database server for current datetime using entity framework?

Posted by Levelbit on Stack Overflow See other posts from Stack Overflow or by Levelbit
Published on 2010-04-06T13:48:46Z Indexed on 2010/04/06 13:53 UTC
Read the original article Hit count: 248

Filed under:

I don't want for my current ModifeidDateTime to be machine time already server time. Every time I want to update or add a person to my datebase on SQL Server 2008 I want to fill ModifiedDateTime filed. It's not like I can change update query as with data adapter command when I work with dataset and to define for my ModifiedDateTime filed to be =GetDate(). I created stored function to retutn me a value of GetDate() method, but I have a problem to import procedure which returns values as int, string ... or no value at all, already just entity values as Person for example in my case. Why is that? Anyway, It would be of great help if you can provide me any solution that works to retrieve DateTime value from server.

© Stack Overflow or respective owner

Related posts about entity-framework