开发者

How to get CurrentTime from SQL Server with LINQ/Entities/VB.Net

开发者 https://www.devze.com 2023-04-04 13:26 出处:网络
I am using LINQ with Entity Framework, and I need to get the SQL server time. Can anyone tell me how can I 开发者_如何学Pythoncreate a method so it retrieves the current server time?

I am using LINQ with Entity Framework, and I need to get the SQL server time. Can anyone tell me how can I 开发者_如何学Pythoncreate a method so it retrieves the current server time? Thank you.


Just execute a ExecuteStoreQuery command.

Dim dateTimeVal As DateTime = context.ExecuteStoreQuery(Of DateTime)("select getdate()").First()
0

精彩评论

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