由于一個產品可能屬于多種分類。所以Products表中的CategoryIDs格式是用"1,2,3"這種形式。搜索指定類別的產品時,使用Linq to sqlIQuarable<Product> result = from p in dataContext.Products where p.CategoryIDs.Split(',').Contains(categoryID.ToString());會拋異常。base {System.SystemException} = {"Comparison operators not supported for type 'System.String[]'"}不知道是何原因。
- 2 回答
- 0 關注
- 269 瀏覽
添加回答
舉報
0/150
提交
取消