0
我想查詢其中該列IS NULL記錄可空類型:比較WHERE的LINQ子句SQL VB.NET
Dim UnassignedSubSvc =
(From c In CurrentContext.SubService
Where c.Product.ProductSubServiceId **is null**
Select c).ToList()
我想查詢其中該列IS NULL記錄可空類型:比較WHERE的LINQ子句SQL VB.NET
Dim UnassignedSubSvc =
(From c In CurrentContext.SubService
Where c.Product.ProductSubServiceId **is null**
Select c).ToList()
Dim UnassignedSubSvc =
(From c In CurrentContext.SubService
Where Not c.ProductSubServiceId.HasValue
Select c).ToList()
可空類型使用HasValue
來表示它們含有非空值,所以簡單否定就足夠了。
嗨,我得到的錯誤HAsvalue不是整數 – BumbleBee
的成員然後你的'ProductSubServiceId'沒有設置爲可以在元數據文件(.EDMX文件)爲空。修復你的數據庫模式。 – Blindy
ProductSubServiceID是表中的refertial鍵。 – BumbleBee