开发者

CurrentDateTime() in EF

开发者 https://www.devze.com 2023-03-06 15:29 出处:网络
I use this code to get Server Date but I really don\'t understand.CreateDateTime() is not a sql function.so what is it?

I use this code to get Server Date but I really don't understand.CreateDateTime() is not a sql function.so what is it?

DateTime ServerDate = Entities.Cre开发者_如何学GoateQuery<DateTime>("CurrentDateTime()").AsEnumerable().First();

I think the string that comes in CreateQuery function must be a sql query.Is it wrong?

I have open the SSMS and write CurrentDateTime() and i got an error,I have test this too: SELECT CurrentDateTime(), and i got an error agian,CurrentDateTime() is not a sql function


CurrentDateTime() is one of the Date and Time Canonical Functions of the Entity SQL.

0

精彩评论

暂无评论...
验证码 换一张
取 消