错误 - {"从物化的'System.Decimal'类型到可为空的'System.Int64'类型的指定强制转换无效。"} [英] Error - {"The specified cast from a materialized 'System.Decimal' type to a nullable 'System.Int64' type is not valid."}

查看:296
本文介绍了错误 - {"从物化的'System.Decimal'类型到可为空的'System.Int64'类型的指定强制转换无效。"}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经针对我的EDM创建并执行了下面的查询:








var q = context 。ORDERS.GroupBy( o = > o.OR_CUSTOMER)。选择( op = > new {op .Key, 总计 = op 。总和( o = > o.OR_QTY)});

解决方案

不确定但是你不能这样做

< font style ="color:red; margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px;填充左:0像素;边框顶宽度:0像素;右边框宽度:0像素;边界底部宽度:0像素;左边框宽度:0像素;边框样式:初始;边框颜色:初始; font-weight:inherit; font-style:inherit; font-family:inherit"> Total = <字体风格="颜色:蓝;边距:0像素;边缘右:0像素;边距:0像素;保证金左:0像素;填充顶:0像素;填充右:0像素;填充底:0像素;填充-left:0像素;边框顶宽度:0像素;右边框宽度:0像素;边界底部宽度:0像素;左边框宽度:0像素;边框样式:初始;边框颜色:初始;字体-weight:inherit; font-style:inherit; font-family:inherit"> op 萨姆( o = > (十进制)o.OR_QTY)} 结果

Hi,

I have created and executed the query below against my EDM:

var q = context.ORDERS.GroupBy(o => o.OR_CUSTOMER).Select(op => new { op.Key, Total = op.Sum(o => o.OR_QTY) }); 

解决方案

Not sure but can u not do this

Total = op.Sum(o => (decimal)o.OR_QTY) }


这篇关于错误 - {&quot;从物化的'System.Decimal'类型到可为空的'System.Int64'类型的指定强制转换无效。&quot;}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆