c# - c# datagridView , 显示总价
问题描述
嗨,我想生成每个售出产品的总价格。我的桌子就像你在附图中看到的那样它在没有总价的情况下工作。我的意思是仅使用 prtoductType 和 Totalsold 才能正常工作。但我想显示这种产品的总价。我的代码如下但不工作,请帮忙!
var result = (from s in db.SaleDetails
join p in db.Product on s.ProductId equals p.ProductId
group s by p.Description into g
select new
{
ProductType = g.Key,
TolatlSold = g.Count(),
TotalPrice = g.Count() *//Times what ?? I tried g.Count()*p.price but I can't
}).ToList();
解决方案
推荐阅读
- python-3.x - Heroku 的 Botocore 错误:botocore.exceptions.NoCredentialsError:无法找到凭据
- python-3.x - 如何使用 python 在 Azure 函数中设置名称和位置的输出绑定?
- scala - 使用 DataFrame 在数据块中的火花流上以小写形式接收的输入数据
- database - 查找具有相似邻居的节点
- php - 根据邮政编码的邻近查询获取地点
- c++ - 如何使用 GIL 迭代器设置像素
- javascript - 数组不同时如何更改类别?
- python - 嵌套字典迭代
- java - JAVA中没有双引号的ExpressionParser
- excel - FormulaArray 突击队不适用于 VBA 执行代码