本文介绍了在Linq中大于等于的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

LinQ代码中的

如何对像这样的字符串字段应用比操作数更多的内容:

in LinQ code

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

db.table.where(c=>c.txtFromDate>"2000/12/05")

推荐答案

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


db.table.where(c=>c.txtFromDate.Date >= Convert.ToDateTime("2000/12/05"))


这篇关于在Linq中大于等于的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 06:00