1
我如何在C#中聚集有條件如何做到這一點在C#
如以下VB代碼:
Dim movement = From item In dbo.VIEWITEMMOVEMENTs
Where item.DATETRANSFERRED.Value.Date = Me.DateTimePicker1.Value.Date
Group By item.DATETRANSFERRED.Value.Date, item.ITEMDESCRIPTION
Into moved = Group, sold = Sum(item.QUANTITYSOLD), [IN] = Sum(If(item.QUANTITY < 0.0, 0.0, item.QUANTITY)), Out = Sum(If(item.QUANTITY > 0, 0, item.QUANTITY))
Select ITEMDESCRIPTION, sold, [IN], Out Order By ITEMDESCRIPTION Ascending
Me.DataGridView1.DataSource = movement
你試過了什麼? C#幾乎完全相同。 – Oded 2012-02-27 16:00:01
這類問題並不適合本網站。主題行也沒什麼用處 - 這是搜索證明。 – 2012-02-27 16:07:59