由于一个产品可能属于多种分类。所以Products表中的CategoryIDs格式是用"1,2,3"这种形式。
搜索指定类别的产品时,使用Linq to sql
IQuarable<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[]'"}不知道是何原因。
绝地无双
慕神8447489