我现在有一些参数的搜索代码,我想在数字之间插入(检查exchangeNo
和exchangeNo2
MinutesNo
),数据库中的MinutesNo
是字符串字段exchangeNo & exchangeNo2
这是我的代码:
where stationsID.Contains(station.ID) &&
((exchangeNo == null || exchaminut.MinutesNo.CompareTo(exchangeNo)>=0) &&
(exchangeNo2 == null || exchaminut.MinutesNo.CompareTo(exchangeNo2)<0))&&...
这不能正常工作。我必须做什么?
问题是数据库中字符串无法比较的字段类型,我将其更改为bigint并工作