(from dtContract in dataEntity.contracts
where
(
dtContract.Supplier_ID == suppID &&
dtContract.Contract_Year != null
)
orderby dtContract.Contract_Year
select new
{
year = (int) dtContract.Contract_Year
}).ToList();
上面的LINQ查询转换为以下SQL查询
SELECT
`Project1`.`Supplier_ID`, `Project1`.`C1`
FROM
`contracts` AS `Project1`
WHERE
(`Project1`.`Supplier_ID` = @p__linq__0)
AND (`Project1`.`Contract_Year` IS NOT NULL)
ORDER BY `Project1`.`Contract_Year` ASC;
哪个是抛出异常
未知栏C1
请您说明这背后的原因..?