Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in LinQ code

How to apply more than operand for string fields like this:

db.table.where(c=>c.txtFromDate>"2000/12/05")
Posted
Updated 3-Jan-12 2:16am
v2
Comments
RaviRanjanKr 3-Jan-12 8:16am    
[Edited]Code is wrapped in pre tag[/Edited]

Try this

DateTime date1 = new DateTime(c.txtFromDate);
DateTime date2 = new DateTime("2000/12/05");
db.table.where(c=>DateTime.Compare(date1, date2)>0);


Hope this helps
 
Share this answer
 
Perform with Date attribute and >= operator. Rewritten code is:

C#
db.table.where(c=>c.txtFromDate.Date >= Convert.ToDateTime("2000/12/05"))
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900