Join multiple DataRows into a single DataRow

前端 未结 4 1726
轻奢々
轻奢々 2021-01-26 09:15

I am writing this in C# using .NET 3.5. I have a System.Data.DataSet object with a single DataTable that uses the following schema:

Id      :  uint
AddressA:  s         


        
4条回答
  •  离开以前
    2021-01-26 10:15

    I agree with Steven as well that doing this on the server side is the best option. If you are using .NET 3.5 though, you don't have to go through what Rune suggests. Rather, use the extension methods for datasets to help query and sum the values.

    Then, you can map it easily to an anonymous type which you can set as the data source for your grid (assuming you don't allow edits to this, which I don't see how you can, since you are aggregating the data).

提交回复
热议问题