I am using LINQ with Entity Framework, and I need to get the SQL server time. Can anyone tell me how can I create 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()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With