Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: .NET
Expertise: Intermediate
Jun 2, 2017

Can't use the "Between" Keyword in a LINQ Query

You can't use the "Between" keyword in a LINQ query.

The sample snippet below shows how you translate between two date fields.

DateTime fromDate = DateTime.Now.AddMonths(-3); 
DateTime endDate = DateTime.Now; 
//linq query 
var result = from te in datatable.AsEnumerable() 
                        where (te.Field("Month") = fromDate) 
                        && (te.Field("Month")
Srinath M S
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date