DataRow drt = null;
var tlist = dt.Select("Atmbs LIKE ‘%" + d["Two_Code"] + "%‘").AsEnumerable().GroupBy(a => a.Field<string>("STATUS_MISSIONN")).Select(e => new { STATUS_MISSIONN = e.Key, Number = e.Count() });
tlist.AsParallel().ForAll(item =>
{
lock (_lock)
{
drt = dtCopy.NewRow();
drt["atmb"] = d["Short_Name"];
drt["STATUS_MISSIONN"] = item.STATUS_MISSIONN;
drt["STATUS_MISSIONNCOUNT"] = item.Number;
dtCopy.Rows.Add(drt);
}
});
private readonly static object _lock = new object();
时间: 2024-10-10 04:10:57