我有一张顾客表
Customer ID Name
1 John
2 Lewis
3 Mary
Run Code Online (Sandbox Code Playgroud)
我有另一张表CustomerRewards
TypeID Description
1 Bronze
2 Silver
3 Gold
4 Platinum
5 AnotherOne
Run Code Online (Sandbox Code Playgroud)
决赛桌
RewardID TypeID CustomerID
1 1 1
2 1 1
3 2 1
4 2 2
Run Code Online (Sandbox Code Playgroud)
customerTypes表是动态的,可以添加和删除许多这些类型.基本上我想要的是动态生成的列和每个列中的计数,类似于
CustomerName Bronze Silver Gold Platinum AnotherOne total
John 2 1 0 0 0 3
Lewis 0 1 0 0 0 1
Grand TOTAL 2 2 0 0 0 4
Run Code Online (Sandbox Code Playgroud)
问题就像我说的那样,类型是动态的,客户是动态的,所以我需要根据系统中的类型使列成为动态的
我已经在DataGridView中标记了c#,因为我需要它
提前致谢