我需要在 C# 中对大型数据库执行 LINQ 查询。我需要在查询中使用的列之一是双列。我需要省略此列中小数点后 4 位以上的结果。数据库无法更改,因为其他程序需要使用它并使用我不想要的东西。然后将结果添加到列表中以供以后使用。我认为这会奏效。
where fun.Units != '*.?????*'
但是,它会返回字符文字中有太多字符的错误。到目前为止,整个查询看起来像这样
var clientQuery1 = from cli in main1.Clients
from pol in main1.Policies
from fun in main1.FundHoldings
from uni in main1.UnitPrices
where cli.AccountNumber == accNum
&& pol.ClientRef == cli.ClientRef
&& fun.FKeyRef == pol.PolicyRef
&& uni.UnitPriceRef == fun.UnitPriceRef
&& fun.Units != '*.?????*'
select uni.UnitName;