LINQ Tip of the week: System.DateTime support

Posted by: the telerik blogs, on 16 Sep 2009 | View original | Bookmarked: 0 time(s)

Continuing with the LINQ tips, today we provide a list of System.DateTime properties and methods that are supported by the Telerik OpenAccess ORM LINQ implementation. The table below provides the equivalent SQL function call for every member.

 

Please note that the table lists the MS SqlServer specific SQL translation.

 

Properties

DateTime.Day DAY(date)
DateTime.Hour DATEPART(hour, date)

DateTime.Millisecond

DATEPART(millisecond,date)
DateTime.Minute DATEPART(minute, date)
DateTime.Month MONTH(date)
DateTime.Second DATEPART(second, date)
DateTime.Year YEAR(date)

 

Static Methods

DateTime.Parse(String) value is parsed on the client side and the result is pushed to the server as filter
DateTime.Parse(String,IFormatProvider) value is parsed on the client side and the result is pushed to the server as filter
DateTime.Parse(String,IFormatProvider,DateTimeStyles) value is parsed on the client side and the result is pushed to the server as filter

 

The various comparison operators that are overloaded by System.DateTime are automatically supported.

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: SQL | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1187 | Hits: 118

Similar Posts

  • Open SQL Port for specific IP by ASP.NET Website more
  • Update to Logging in to DotNetNuke from a Silverlight Application with RIA Authentication more
  • SQL 2008 CLR Triggers, use a .NET class library in SQL using WPF more
  • WSE, DIME; WCF, MTOM; OH My! more
  • Exposing Custom WCF Headers through WCF Behaviors more
  • Twitterjecting more
  • Silverlight SVC Web Service problems on IIS more
  • The Twitter Search API made easy with Linq to XML more
  • Creating Extension Methods in VB more
  • Html and Uri String Encoding without System.Web more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD