DataContext.ExecuteCommand("DELETE from Table WHERE Date < Now()");
I get a message that Now () is not a recognized built-in function name.
When sending a SQL query directly to SQL Server, you need to use SQL Server functions, not .NET.
Use this instead:
DataContext.ExecuteCommand("DELETE from Table WHERE Date < GETDATE()");
GETDATE() - T-SQL equivalent for Now ()
GETDATE()
Now () is not TSQL. Use GETDATE () or GETUTCDATE ()
GetDate() Now()?
GetDate()
Now()
GETDATE() NOW()
NOW()
, Now() SQL.
Source: https://habr.com/ru/post/1748164/More articles:Help with proxy name and pass with GeckoFX? - c #Integrated SQL design, help / recommendations - sqlКак управлять номером страницы в FOP? - xsl-foПолучить информацию из высшего класса? - oopWhat is the best resource for developing Windows drivers? - windowsphp simplexml_load_file () with password protected url - phpCohan inheritance - phpIs it possible to run the Silverlight 4 OOB application from a web page? - silverlightLarge table in iFrame crashes IE8 - asp.netHow can I use Shell32.dll in Silverlight OOB - pinvokeAll Articles