【发布时间】:2018-08-31 23:06:36
【问题描述】:
我有类似的数据
ConcurrentDictionary<string, ConcurrentDictionary<string,string> OneTwoThree =
new ConcurrentDictionary<string, ConcurrentDictionary<string, string>();
我想要这样的结果Final Image 我尝试了什么:
DataTable dt = new DataTable();
dt.Columns.Add("TwoDetails");
ISet<string> two = new HashSet<string>();
Parallel.ForEach(OneTwoThree , One=>
{
dt.Columns.Add(One.Key);
foreach(var Two in One.Value)
{
two.Add(Two.Key); // To get Distinct Values
}
});
foreach(var item in two)
{
var row = dt.NewRow();
row["TwoDetails"] = row;
}
现在我没有将“三值”附加到特定单元格的想法,如图所示。
任何建议。
【问题讨论】:
-
@TimSchmelter.. 如果行名和列名存在,你如何在单元格中插入数据(这是行名和列名的交集)。
-
@sachin .. 我在这里处理行名,在数据表中创建新行时对其进行排序。
-
有什么建议吗?
标签: c# dictionary datatable