-1
我正在處理包含BookNumber,Title,AuthorNum,Price和quantityInStock的datagridview。我必須製作一個顯示庫存總量(價格*數量總和)的按鈕。我已經創建了一個按鈕,顯示書籍的成本如何使用集合運算符計算總和*數量?
Dim totCost As Double = Aggregate r In BooksDataSet.tblBooks
Select r.Price Into Sum()
MessageBox.Show("Total price for all Books is: " & totCost.ToString("c"))
但我不確定如何使用聚合來進行乘法運算。任何幫助,將不勝感激。下面是我用
BookNumber Title AuthorNum Price QuantityInStock
101 Garden of Eden 1 $35.99 15
146 Rosebud 1 $24.50 20
224 Cycle World 2 $15.99 5
我們展示數據的例子。 – DarkKnight