Web Api 2指定演员表无效

时间:2016-03-08 06:14:11

标签: asp.net angularjs c#-4.0 linq-to-sql

每当我在查询中加上 case 时,它会出现错误"指定的强制转换无效"在linq到sql C#但是 它在Sql server 2008中运行良好。

使用

查询iam
select Prod_StyleID,S.STYLECODE,STYLENAME,CATEGORYNAME,VENDORNAME,STYLESTATUS,Gendername,
STYLEDESCRIPTION,SHORTDESCRIPTION1,SHORTDESCRIPTION2,SHORTDESCRIPTION3,SHORTDESCRIPTION4,STYLEPRICE,
BRANDNAME,VENDORSTYLECODE,CATEGORYTYPE,1 as ColorATtribute,1 as SizeAttribute,
case when s.styleprice = '0' then sp.regularprice  when s.styleprice = '1' then
sp.saleprice else closeoutprice end as Regularprice from prod_style S inner join prod_styleprice SP on s.stylecode = sp.stylecode where (S.STYLECODE LIKE @stylecode+'%' OR S.VENDORSTYLECODE like @stylecode+'%')
and S.CATEGORYNAME <> 'Made to Order' and S.STYLESTATUS = 'Active' and sp.pricefrom ='1'

请帮助

0 个答案:

没有答案